Create kdeconnect_add_kcm cmake function

This way, the namespace info is not duplicated within the buildsystem and we have a more reasonable place to put the QML file install into
This commit is contained in:
Alexander Lohnau 2023-08-06 11:46:20 +02:00
parent e598a997e7
commit cdc8428542
7 changed files with 12 additions and 13 deletions

View file

@ -4,7 +4,9 @@
function(kdeconnect_add_plugin) function(kdeconnect_add_plugin)
kcoreaddons_add_plugin(${ARGN} INSTALL_NAMESPACE kdeconnect) kcoreaddons_add_plugin(${ARGN} INSTALL_NAMESPACE kdeconnect)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}_config.qml") endfunction()
install(FILES "${ARGV0}_config.qml" DESTINATION ${KDE_INSTALL_DATADIR}/kdeconnect)
endif() function(kdeconnect_add_kcm plugin)
kcoreaddons_add_plugin(${plugin} ${ARGN} INSTALL_NAMESPACE kdeconnect/kcms)
install(FILES "${plugin}.qml" DESTINATION ${KDE_INSTALL_DATADIR}/kdeconnect)
endfunction() endfunction()

View file

@ -12,8 +12,7 @@ target_link_libraries(kdeconnect_clipboard kdeconnectcore
${kdeconnect_clipboard_WL_LINK_LIBS} ${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) ki18n_wrap_ui(kdeconnect_clipboard_config clipboard_config.ui)
target_link_libraries(kdeconnect_clipboard_config target_link_libraries(kdeconnect_clipboard_config
kdeconnectcore kdeconnectcore

View file

@ -19,10 +19,9 @@ if (NOT WIN32)
) )
endif() 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) ki18n_wrap_ui(kdeconnect_findthisdevice_config findthisdevice_config.ui)
target_sources(kdeconnect_findthisdevice_config PRIVATE findthisdevice_config.cpp)
target_link_libraries(kdeconnect_findthisdevice_config target_link_libraries(kdeconnect_findthisdevice_config
kdeconnectpluginkcm kdeconnectpluginkcm
Qt::Multimedia Qt::Multimedia

View file

@ -28,7 +28,7 @@ endif()
####################################### #######################################
# Config # 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) ki18n_wrap_ui(kdeconnect_pausemusic_config pausemusic_config.ui)
target_link_libraries(kdeconnect_pausemusic_config target_link_libraries(kdeconnect_pausemusic_config

View file

@ -12,7 +12,7 @@ target_link_libraries(kdeconnect_runcommand
KF${QT_MAJOR_VERSION}::I18n) KF${QT_MAJOR_VERSION}::I18n)
#---------------------- #----------------------
kcoreaddons_add_plugin(kdeconnect_runcommand_config SOURCES runcommand_config.cpp INSTALL_NAMESPACE "kdeconnect/kcms") kdeconnect_add_kcm(kdeconnect_runcommand_config SOURCES runcommand_config.cpp)
target_link_libraries(kdeconnect_runcommand_config target_link_libraries(kdeconnect_runcommand_config
kdeconnectcore kdeconnectcore
kdeconnectpluginkcm kdeconnectpluginkcm

View file

@ -1,4 +1,3 @@
kdeconnect_add_plugin(kdeconnect_sendnotifications) kdeconnect_add_plugin(kdeconnect_sendnotifications)
target_sources(kdeconnect_sendnotifications PRIVATE target_sources(kdeconnect_sendnotifications PRIVATE
@ -22,7 +21,7 @@ target_link_libraries(kdeconnect_sendnotifications
) )
# Config # 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) ki18n_wrap_ui(kdeconnect_sendnotifications_config sendnotifications_config.ui)
target_sources(kdeconnect_sendnotifications_config PRIVATE target_sources(kdeconnect_sendnotifications_config PRIVATE

View file

@ -21,7 +21,7 @@ target_link_libraries(kdeconnect_share
####################################### #######################################
# Config # 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) ki18n_wrap_ui(kdeconnect_share_config share_config.ui)
target_link_libraries(kdeconnect_share_config target_link_libraries(kdeconnect_share_config