Commit 52b1f4c3 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port to ECMQmlModule

parent c97516bf
Pipeline #139819 passed with stages
in 5 minutes and 36 seconds
......@@ -10,7 +10,7 @@ set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(KPublicTransport VERSION ${RELEASE_SERVICE_VERSION})
find_package(ECM 5.85 REQUIRED NO_MODULE)
find_package(ECM 5.91 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDECompilerSettings NO_POLICY_SCOPE)
......@@ -24,6 +24,7 @@ include(KDEInstallDirs)
include(KDECMakeSettings)
include(GenerateExportHeader)
include(ECMAddQch)
include(ECMQmlModule)
option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
......
# SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
add_library(kpublictransportqmlplugin)
target_sources(kpublictransportqmlplugin PRIVATE
kpublictransportqmlplugin.cpp
linemetadatawrapper.cpp
)
ecm_add_qml_module(kpublictransportqmlplugin URI "org.kde.kpublictransport" VERSION 1.0)
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(kpublictransportqmlplugin PRIVATE -DQT_PLUGIN -DQT_STATICPLUGIN=1)
set_target_properties(kpublictransportqmlplugin PROPERTIES AUTOMOC_MOC_OPTIONS -Muri=org.kde.kpublictransport)
target_sources(kpublictransportqmlplugin PRIVATE kpublictransportqml.qrc)
endif()
target_link_libraries(kpublictransportqmlplugin
Qt5::Qml
KPublicTransport
)
# make examples work without installation
set_property(TARGET kpublictransportqmlplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/kpublictransport)
file(COPY qmldir DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/kpublictransport)
install(TARGETS kpublictransportqmlplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kpublictransport)
install(FILES qmldir ${qml_SRC} DESTINATION ${QML_INSTALL_DIR}/org/kde/kpublictransport)
target_sources(kpublictransportqmlplugin PRIVATE kpublictransportqmlplugin.cpp linemetadatawrapper.cpp)
target_link_libraries(kpublictransportqmlplugin PRIVATE Qt::Quick KPublicTransport)
ecm_finalize_qml_module(kpublictransportqmlplugin DESTINATION ${KDE_INSTALL_QMLDIR})
<!--
SPDX-FileCopyrightText: None
SPDX-License-Identifier: CC0-1.0
-->
<RCC>
<qresource prefix="/org/kde/kpublictransport/">
<file>qmldir</file>
</qresource>
</RCC>
module org.kde.kpublictransport
plugin kpublictransportqmlplugin
classname KPublicTransportQmlPlugin
SPDX-License-Identifier: CC0-1.0
SPDX-FileCopyrightText: Volker Krause <vkrause@kde.org>
# SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
add_library(kpublictransportquickplugin)
ecm_add_qml_module(kpublictransportquickplugin URI "org.kde.kpublictransport.ui" VERSION 1.0)
target_sources(kpublictransportquickplugin PRIVATE
kpublictransportquickplugin.cpp
styledframesvgitem.cpp
......@@ -9,24 +10,8 @@ target_sources(kpublictransportquickplugin PRIVATE
assets/assets.qrc
)
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(kpublictransportquickplugin PRIVATE -DQT_PLUGIN -DQT_STATICPLUGIN=1)
set_target_properties(kpublictransportquickplugin PROPERTIES AUTOMOC_MOC_OPTIONS -Muri=org.kde.kpublictransport.ui)
target_sources(kpublictransportquickplugin PRIVATE kpublictransportquick.qrc)
endif()
set(kpublictransportquickplugin_qml
qmldir
VehicleSectionItem.qml
)
target_link_libraries(kpublictransportquickplugin
Qt5::Quick
)
ecm_target_qml_sources(kpublictransportquickplugin SOURCES VehicleSectionItem.qml VERSION 1.0)
# make examples work without installation
set_property(TARGET kpublictransportquickplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/kpublictransport/ui)
file(COPY ${kpublictransportquickplugin_qml} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/kpublictransport/ui)
target_link_libraries(kpublictransportquickplugin PRIVATE Qt::Quick)
install(TARGETS kpublictransportquickplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kpublictransport/ui)
install(FILES ${kpublictransportquickplugin_qml} ${quick_SRC} DESTINATION ${QML_INSTALL_DIR}/org/kde/kpublictransport/ui)
ecm_finalize_qml_module(kpublictransportquickplugin DESTINATION ${KDE_INSTALL_QMLDIR})
<!--
SPDX-FileCopyrightText: None
SPDX-License-Identifier: CC0-1.0
-->
<RCC>
<qresource prefix="/org/kde/kpublictransport/ui">
<file>qmldir</file>
<file>VehicleSectionItem.qml</file>
</qresource>
</RCC>
module org.kde.kpublictransport.ui
plugin kpublictransportquickplugin
classname KPublicTransportQuickPlugin
VehicleSectionItem 1.0 VehicleSectionItem.qml
SPDX-License-Identifier: CC0-1.0
SPDX-FileCopyrightText: Volker Krause <vkrause@kde.org>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment