diff --git a/KDEConnectMacros.cmake b/KDEConnectMacros.cmake index 8b1cc09b6..6643c862c 100644 --- a/KDEConnectMacros.cmake +++ b/KDEConnectMacros.cmake @@ -4,7 +4,9 @@ function(kdeconnect_add_plugin) kcoreaddons_add_plugin(${ARGN} INSTALL_NAMESPACE kdeconnect) - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}_config.qml") - install(FILES "${ARGV0}_config.qml" DESTINATION ${KDE_INSTALL_DATADIR}/kdeconnect) - endif() +endfunction() + +function(kdeconnect_add_kcm plugin) + kcoreaddons_add_plugin(${plugin} ${ARGN} INSTALL_NAMESPACE kdeconnect/kcms) + install(FILES "${plugin}.qml" DESTINATION ${KDE_INSTALL_DATADIR}/kdeconnect) endfunction() diff --git a/plugins/clipboard/CMakeLists.txt b/plugins/clipboard/CMakeLists.txt index 05861f517..576acc470 100644 --- a/plugins/clipboard/CMakeLists.txt +++ b/plugins/clipboard/CMakeLists.txt @@ -12,8 +12,7 @@ target_link_libraries(kdeconnect_clipboard kdeconnectcore ${kdeconnect_clipboard_WL_LINK_LIBS} ) -kcoreaddons_add_plugin(kdeconnect_clipboard_config SOURCES clipboard_config.cpp INSTALL_NAMESPACE "kdeconnect/kcms") - +kdeconnect_add_kcm(kdeconnect_clipboard_config SOURCES clipboard_config.cpp) ki18n_wrap_ui(kdeconnect_clipboard_config clipboard_config.ui) target_link_libraries(kdeconnect_clipboard_config kdeconnectcore diff --git a/plugins/findthisdevice/CMakeLists.txt b/plugins/findthisdevice/CMakeLists.txt index 4ed58484c..eeda6e469 100644 --- a/plugins/findthisdevice/CMakeLists.txt +++ b/plugins/findthisdevice/CMakeLists.txt @@ -19,10 +19,9 @@ if (NOT WIN32) ) endif() -kcoreaddons_add_plugin(kdeconnect_findthisdevice_config INSTALL_NAMESPACE "kdeconnect/kcms") +kdeconnect_add_kcm(kdeconnect_findthisdevice_config SOURCES findthisdevice_config.cpp) ki18n_wrap_ui(kdeconnect_findthisdevice_config findthisdevice_config.ui) -target_sources(kdeconnect_findthisdevice_config PRIVATE findthisdevice_config.cpp) target_link_libraries(kdeconnect_findthisdevice_config kdeconnectpluginkcm Qt::Multimedia diff --git a/plugins/pausemusic/CMakeLists.txt b/plugins/pausemusic/CMakeLists.txt index 4b49b1917..a6bb96abe 100644 --- a/plugins/pausemusic/CMakeLists.txt +++ b/plugins/pausemusic/CMakeLists.txt @@ -28,7 +28,7 @@ endif() ####################################### # Config -kcoreaddons_add_plugin(kdeconnect_pausemusic_config SOURCES pausemusic_config.cpp INSTALL_NAMESPACE "kdeconnect/kcms") +kdeconnect_add_kcm(kdeconnect_pausemusic_config SOURCES pausemusic_config.cpp) ki18n_wrap_ui(kdeconnect_pausemusic_config pausemusic_config.ui) target_link_libraries(kdeconnect_pausemusic_config diff --git a/plugins/runcommand/CMakeLists.txt b/plugins/runcommand/CMakeLists.txt index 381ad0ff1..74e219d4b 100644 --- a/plugins/runcommand/CMakeLists.txt +++ b/plugins/runcommand/CMakeLists.txt @@ -12,8 +12,8 @@ target_link_libraries(kdeconnect_runcommand KF${QT_MAJOR_VERSION}::I18n) #---------------------- -kcoreaddons_add_plugin(kdeconnect_runcommand_config SOURCES runcommand_config.cpp INSTALL_NAMESPACE "kdeconnect/kcms") -target_link_libraries( kdeconnect_runcommand_config +kdeconnect_add_kcm(kdeconnect_runcommand_config SOURCES runcommand_config.cpp) +target_link_libraries(kdeconnect_runcommand_config kdeconnectcore kdeconnectpluginkcm KF${QT_MAJOR_VERSION}::I18n diff --git a/plugins/sendnotifications/CMakeLists.txt b/plugins/sendnotifications/CMakeLists.txt index b875360df..572a9fe59 100644 --- a/plugins/sendnotifications/CMakeLists.txt +++ b/plugins/sendnotifications/CMakeLists.txt @@ -1,4 +1,3 @@ - kdeconnect_add_plugin(kdeconnect_sendnotifications) target_sources(kdeconnect_sendnotifications PRIVATE @@ -22,7 +21,7 @@ target_link_libraries(kdeconnect_sendnotifications ) # Config -kcoreaddons_add_plugin(kdeconnect_sendnotifications_config INSTALL_NAMESPACE "kdeconnect/kcms") +kdeconnect_add_kcm(kdeconnect_sendnotifications_config) ki18n_wrap_ui(kdeconnect_sendnotifications_config sendnotifications_config.ui) target_sources(kdeconnect_sendnotifications_config PRIVATE diff --git a/plugins/share/CMakeLists.txt b/plugins/share/CMakeLists.txt index 6e57825ba..c2c890d3a 100644 --- a/plugins/share/CMakeLists.txt +++ b/plugins/share/CMakeLists.txt @@ -21,7 +21,7 @@ target_link_libraries(kdeconnect_share ####################################### # Config -kcoreaddons_add_plugin(kdeconnect_share_config SOURCES share_config.cpp INSTALL_NAMESPACE "kdeconnect/kcms") +kdeconnect_add_kcm(kdeconnect_share_config SOURCES share_config.cpp) ki18n_wrap_ui(kdeconnect_share_config share_config.ui) target_link_libraries(kdeconnect_share_config