Commit ed3ae873 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port to ecm_add_qml_module

Reduces some boilerplate
parent 4ecf463c
Pipeline #238085 passed with stage
in 3 minutes and 58 seconds
......@@ -38,6 +38,7 @@ include(GenerateExportHeader)
include(ECMGenerateQmlTypes)
include(KDEClangFormat)
include(KDEGitCommitHooks)
include(ECMQmlModule)
if (NOT SAILFISHOS)
include(ECMQMLModules)
endif()
......
add_library(kdeconnectdeclarativeplugin SHARED
ecm_add_qml_module(kdeconnectdeclarativeplugin URI "org.kde.kdeconnect" VERSION 1.0)
target_sources(kdeconnectdeclarativeplugin PRIVATE
kdeconnectdeclarativeplugin.cpp
responsewaiter.cpp
objectfactory.cpp
pointerlocker.cpp
resources.qrc
)
target_link_libraries(kdeconnectdeclarativeplugin
Qt5::Qml
kdeconnectinterfaces
kdeconnectcore
)
ecm_target_qml_sources(kdeconnectdeclarativeplugin
SOURCES
qml/DBusProperty.qml
qml/PluginChecker.qml
qml/RemoteKeyboard.qml
VERSION 1.0)
if (TARGET KF5::WaylandClient)
target_sources(kdeconnectdeclarativeplugin PRIVATE pointerlockerwayland.cpp)
target_link_libraries(kdeconnectdeclarativeplugin KF5::WaylandClient)
target_link_libraries(kdeconnectdeclarativeplugin PRIVATE KF5::WaylandClient)
target_compile_definitions(kdeconnectdeclarativeplugin PRIVATE -DWITH_WAYLAND=1)
else()
target_compile_definitions(kdeconnectdeclarativeplugin PRIVATE -DWITH_WAYLAND=0)
endif()
install(TARGETS kdeconnectdeclarativeplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kdeconnect)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kdeconnect)
target_link_libraries(kdeconnectdeclarativeplugin PRIVATE Qt::Quick kdeconnectinterfaces kdeconnectcore)
ecm_generate_qmltypes(org.kde.kdeconnect 1.0 DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kdeconnect)
# So qml apps using this plugin can be run from build/bin directory
add_custom_target(copy_to_build_dir_bin)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/org/kde/kdeconnect)
add_custom_command(TARGET copy_to_build_dir_bin
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${CMAKE_BINARY_DIR}/bin/org/kde/kdeconnect/)
add_dependencies(kdeconnectdeclarativeplugin copy_to_build_dir_bin)
set_target_properties(kdeconnectdeclarativeplugin
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/org/kde/kdeconnect/
)
ecm_finalize_qml_module(kdeconnectdeclarativeplugin DESTINATION ${KDE_INSTALL_QMLDIR})
This diff is collapsed.
module org.kde.kdeconnect
DBusProperty 1.0 qrc:///kdeconnect/qml/DBusProperty.qml
PluginChecker 1.0 qrc:///kdeconnect/qml/PluginChecker.qml
RemoteKeyboard 1.0 qrc:///kdeconnect/qml/RemoteKeyboard.qml
plugin kdeconnectdeclarativeplugin
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/kdeconnect">
<file>qml/DBusProperty.qml</file>
<file>qml/PluginChecker.qml</file>
<file>qml/RemoteKeyboard.qml</file>
</qresource>
</RCC>
Supports Markdown
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