From f740a8bda8ed26a21e4c8650e569871944146b99 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Thu, 20 Jul 2023 16:31:40 +0300 Subject: [PATCH] Use target-centric CMake approach for declaring debug category This makes it easier to read, because we do not have to handle a list of files that get added to the targets. In other KDE projects, we also prefer the target centric approach. In case one wants to reuse the same category in multiple places, it would be best to create a small static lib. But for now, this is not needed. --- core/CMakeLists.txt | 18 ++++++-------- daemon/CMakeLists.txt | 10 +++----- fileitemactionplugin/CMakeLists.txt | 9 ++++--- indicator/CMakeLists.txt | 16 ++++++------- kio/CMakeLists.txt | 12 +++------- plugins/battery/CMakeLists.txt | 15 ++++-------- plugins/clipboard/CMakeLists.txt | 10 +------- plugins/connectivity-report/CMakeLists.txt | 13 +++------- plugins/contacts/CMakeLists.txt | 13 +++------- plugins/lockdevice/CMakeLists.txt | 14 +++++------ plugins/mmtelephony/CMakeLists.txt | 12 +++------- plugins/mpriscontrol/CMakeLists.txt | 10 ++++---- plugins/mprisremote/CMakeLists.txt | 16 ++++++++----- plugins/notifications/CMakeLists.txt | 19 ++++----------- plugins/pausemusic/CMakeLists.txt | 14 +++++------ plugins/photo/CMakeLists.txt | 15 ++++-------- plugins/ping/CMakeLists.txt | 14 ++++------- plugins/presenter/CMakeLists.txt | 7 +++--- plugins/remotecommands/CMakeLists.txt | 15 ++++-------- plugins/remotecontrol/CMakeLists.txt | 10 ++++---- plugins/remotekeyboard/CMakeLists.txt | 10 ++++---- plugins/remotesystemvolume/CMakeLists.txt | 15 ++++-------- plugins/runcommand/CMakeLists.txt | 15 ++++-------- plugins/screensaver-inhibit/CMakeLists.txt | 11 ++++----- plugins/sendnotifications/CMakeLists.txt | 22 +++++++---------- plugins/sftp/CMakeLists.txt | 8 +++---- plugins/share/CMakeLists.txt | 13 +++------- plugins/sms/CMakeLists.txt | 25 +++++++++---------- plugins/systemvolume/CMakeLists.txt | 9 ++++--- plugins/telephony/CMakeLists.txt | 15 ++++-------- plugins/virtualmonitor/CMakeLists.txt | 14 +++-------- smsapp/CMakeLists.txt | 28 ++++++++++------------ 32 files changed, 155 insertions(+), 292 deletions(-) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index b8ba38d2b..093df0258 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,13 +1,5 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-core\") -set(debug_file_SRCS) - -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER kdeconnect_debug.h - IDENTIFIER KDECONNECT_CORE CATEGORY_NAME kdeconnect.core - DEFAULT_SEVERITY Warning - EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (core)") - set(KDECONNECT_PRIVATE_DBUS_ADDR unix:tmpdir=/tmp) if(WIN32) set(KDECONNECT_PRIVATE_DBUS_ADDR tcp:host=localhost,port=0) @@ -31,7 +23,8 @@ endif() option(LOOPBACK_ENABLED "Loopback backend enabled" OFF) -set(kdeconnectcore_SRCS +add_library(kdeconnectcore) +target_sources(kdeconnectcore PRIVATE ${backends_kdeconnect_SRCS} backends/linkprovider.cpp @@ -52,10 +45,13 @@ set(kdeconnectcore_SRCS core_debug.cpp notificationserverinfo.cpp openconfig.cpp - ${debug_file_SRCS} ) +ecm_qt_declare_logging_category(kdeconnectcore + HEADER kdeconnect_debug.h + IDENTIFIER KDECONNECT_CORE CATEGORY_NAME kdeconnect.core + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (core)") -add_library(kdeconnectcore ${kdeconnectcore_SRCS}) target_include_directories(kdeconnectcore PUBLIC ${PROJECT_SOURCE_DIR}) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index e9d7e65b0..7a872bcfe 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -1,15 +1,11 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kded") -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER kdeconnectd_debug.h +add_executable(kdeconnectd kdeconnectd.cpp ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc) +ecm_qt_declare_logging_category(kdeconnectd + HEADER kdeconnectd_debug.h IDENTIFIER KDECONNECT_DAEMON CATEGORY_NAME kdeconnect.daemon DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (daemon)") - -qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc) - -add_executable(kdeconnectd kdeconnectd.cpp ${kdeconnect_custom_icons_SRCS} ${debug_file_SRCS}) target_link_libraries(kdeconnectd kdeconnectcore kdeconnectversion KF${QT_MAJOR_VERSION}::KIOWidgets diff --git a/fileitemactionplugin/CMakeLists.txt b/fileitemactionplugin/CMakeLists.txt index 59478b7b7..bbd99aecd 100644 --- a/fileitemactionplugin/CMakeLists.txt +++ b/fileitemactionplugin/CMakeLists.txt @@ -1,13 +1,12 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-fileitemaction") -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER kdeconnect_fileitemaction_debug.h +add_library(kdeconnectfileitemaction MODULE sendfileitemaction.cpp) + +ecm_qt_declare_logging_category(kdeconnectfileitemaction + HEADER kdeconnect_fileitemaction_debug.h IDENTIFIER KDECONNECT_FILEITEMACTION CATEGORY_NAME kdeconnect.fileitemaction DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (fileitemaction)") - -add_library(kdeconnectfileitemaction MODULE sendfileitemaction.cpp ${debug_file_SRCS}) target_link_libraries( kdeconnectfileitemaction KF${QT_MAJOR_VERSION}::KIOWidgets diff --git a/indicator/CMakeLists.txt b/indicator/CMakeLists.txt index 558437850..0e08c0e36 100644 --- a/indicator/CMakeLists.txt +++ b/indicator/CMakeLists.txt @@ -1,12 +1,5 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-indicator\") -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER indicator_debug.h - IDENTIFIER KDECONNECT_INDICATOR CATEGORY_NAME kdeconnect.indicator - DEFAULT_SEVERITY Warning - EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (indicator)") - qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc) set(indicator_SRCS @@ -39,7 +32,14 @@ else () list(APPEND indicator_SRCS indicatorhelper.cpp) endif() -add_executable(kdeconnect-indicator ${indicator_SRCS} ${debug_file_SRCS}) +add_executable(kdeconnect-indicator ${indicator_SRCS}) + +ecm_qt_declare_logging_category(kdeconnect-indicator + HEADER indicator_debug.h + IDENTIFIER KDECONNECT_INDICATOR CATEGORY_NAME kdeconnect.indicator + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (indicator)") + target_include_directories(kdeconnect-indicator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/systray_actions) diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt index 16021b765..c3112ee07 100644 --- a/kio/CMakeLists.txt +++ b/kio/CMakeLists.txt @@ -1,18 +1,12 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kio") -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER kdeconnectkio_debug.h +add_library(kio_kdeconnect MODULE kiokdeconnect.cpp) +ecm_qt_declare_logging_category(kio_kdeconnect + HEADER kdeconnectkio_debug.h IDENTIFIER KDECONNECT_KIO CATEGORY_NAME kdeconnect.kio DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (kio)") -set(kio_kdeconnect_PART_SRCS - kiokdeconnect.cpp - ${debug_file_SRCS} -) - -add_library(kio_kdeconnect MODULE ${kio_kdeconnect_PART_SRCS}) target_link_libraries(kio_kdeconnect kdeconnectinterfaces diff --git a/plugins/battery/CMakeLists.txt b/plugins/battery/CMakeLists.txt index c0e47f400..aaf549ff0 100644 --- a/plugins/battery/CMakeLists.txt +++ b/plugins/battery/CMakeLists.txt @@ -1,17 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_battery_debug.h +kdeconnect_add_plugin(kdeconnect_battery SOURCES batteryplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_battery + HEADER plugin_battery_debug.h IDENTIFIER KDECONNECT_PLUGIN_BATTERY CATEGORY_NAME kdeconnect.plugin.battery DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin battery)") - -set(kdeconnect_battery_SRCS - batteryplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_battery SOURCES ${kdeconnect_battery_SRCS}) - target_link_libraries(kdeconnect_battery kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus diff --git a/plugins/clipboard/CMakeLists.txt b/plugins/clipboard/CMakeLists.txt index 68577bc0a..22ddbae58 100644 --- a/plugins/clipboard/CMakeLists.txt +++ b/plugins/clipboard/CMakeLists.txt @@ -1,18 +1,10 @@ - -set(debug_file_SRCS) ecm_qt_declare_logging_category( debug_file_SRCS HEADER plugin_clipboard_debug.h IDENTIFIER KDECONNECT_PLUGIN_CLIPBOARD CATEGORY_NAME kdeconnect.plugin.clipboard DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin clipboard)") -set(kdeconnect_clipboard_SRCS - clipboardplugin.cpp - clipboardlistener.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_clipboard SOURCES ${kdeconnect_clipboard_SRCS}) +kdeconnect_add_plugin(kdeconnect_clipboard SOURCES clipboardplugin.cpp clipboardlistener.cpp ${debug_file_SRCS}) target_link_libraries(kdeconnect_clipboard kdeconnectcore KF${QT_MAJOR_VERSION}::GuiAddons diff --git a/plugins/connectivity-report/CMakeLists.txt b/plugins/connectivity-report/CMakeLists.txt index f8d18007a..64bb81c62 100644 --- a/plugins/connectivity-report/CMakeLists.txt +++ b/plugins/connectivity-report/CMakeLists.txt @@ -1,17 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_connectivity_report_debug.h +kdeconnect_add_plugin(kdeconnect_connectivity_report SOURCES connectivity_reportplugin.cpp) +ecm_qt_declare_logging_category(kdeconnect_connectivity_report + HEADER plugin_connectivity_report_debug.h IDENTIFIER KDECONNECT_PLUGIN_CONNECTIVITY_REPORT CATEGORY_NAME kdeconnect.plugin.connectivity_report DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin connectivity_report)") -set(kdeconnect_connectivity_report_SRCS - connectivity_reportplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_connectivity_report SOURCES ${kdeconnect_connectivity_report_SRCS}) - target_link_libraries(kdeconnect_connectivity_report kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus diff --git a/plugins/contacts/CMakeLists.txt b/plugins/contacts/CMakeLists.txt index eedcadd3a..fe7d03116 100644 --- a/plugins/contacts/CMakeLists.txt +++ b/plugins/contacts/CMakeLists.txt @@ -1,17 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_contacts_debug.h +kdeconnect_add_plugin(kdeconnect_contacts SOURCES contactsplugin.cpp) +ecm_qt_declare_logging_category(kdeconnect_contacts + HEADER plugin_contacts_debug.h IDENTIFIER KDECONNECT_PLUGIN_CONTACTS CATEGORY_NAME kdeconnect.plugin.contacts DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin contacts)") -set(kdeconnect_contacts_SRCS - contactsplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_contacts SOURCES ${kdeconnect_contacts_SRCS}) - target_link_libraries(kdeconnect_contacts kdeconnectcore Qt::DBus diff --git a/plugins/lockdevice/CMakeLists.txt b/plugins/lockdevice/CMakeLists.txt index 6ac52ffab..b64e1582a 100644 --- a/plugins/lockdevice/CMakeLists.txt +++ b/plugins/lockdevice/CMakeLists.txt @@ -1,21 +1,19 @@ qt_add_dbus_interface(lockdevice_SRCS org.freedesktop.login1.xml login1dbusinterface) qt_add_dbus_interface(lockdevice_SRCS org.freedesktop.DBus.Properties.xml propertiesdbusinterface) -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_lock_debug.h - IDENTIFIER KDECONNECT_PLUGIN_LOCKREMOTE CATEGORY_NAME kdeconnect.plugin.lock - DEFAULT_SEVERITY Warning - EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin lockremote)") - if (WIN32) list(APPEND lockdevice_SRCS lockdeviceplugin-win.cpp) else () list(APPEND lockdevice_SRCS lockdeviceplugin.cpp) endif() -kdeconnect_add_plugin(kdeconnect_lockdevice SOURCES ${lockdevice_SRCS} ${debug_file_SRCS}) +kdeconnect_add_plugin(kdeconnect_lockdevice SOURCES ${lockdevice_SRCS}) +ecm_qt_declare_logging_category(kdeconnect_lockdevice + HEADER plugin_lock_debug.h + IDENTIFIER KDECONNECT_PLUGIN_LOCKREMOTE CATEGORY_NAME kdeconnect.plugin.lock + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin lockremote)") target_link_libraries(kdeconnect_lockdevice kdeconnectcore Qt::DBus diff --git a/plugins/mmtelephony/CMakeLists.txt b/plugins/mmtelephony/CMakeLists.txt index c58d7e6ba..bf7c25b56 100644 --- a/plugins/mmtelephony/CMakeLists.txt +++ b/plugins/mmtelephony/CMakeLists.txt @@ -1,16 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_mmtelephony_debug.h +kdeconnect_add_plugin(kdeconnect_mmtelephony SOURCES mmtelephonyplugin.cpp) +ecm_qt_declare_logging_category(kdeconnect_mmtelephony + HEADER plugin_mmtelephony_debug.h IDENTIFIER KDECONNECT_PLUGIN_MMTELEPHONY CATEGORY_NAME kdeconnect.plugin.mmtelephony DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin mmtelephony)") -set(kdeconnect_mmtelephony_SRCS - mmtelephonyplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_mmtelephony SOURCES ${kdeconnect_mmtelephony_SRCS}) target_link_libraries(kdeconnect_mmtelephony kdeconnectcore diff --git a/plugins/mpriscontrol/CMakeLists.txt b/plugins/mpriscontrol/CMakeLists.txt index 7fb7e2f64..2a437d7c9 100644 --- a/plugins/mpriscontrol/CMakeLists.txt +++ b/plugins/mpriscontrol/CMakeLists.txt @@ -20,15 +20,13 @@ qt_add_dbus_interface(kdeconnect_mpriscontrol_SRCS org.mpris.MediaPlayer2.xml mp endif() -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_mpris_debug.h +kdeconnect_add_plugin(kdeconnect_mpriscontrol SOURCES ${kdeconnect_mpriscontrol_SRCS}) + +ecm_qt_declare_logging_category(kdeconnect_mpriscontrol + HEADER plugin_mpris_debug.h IDENTIFIER KDECONNECT_PLUGIN_MPRIS CATEGORY_NAME kdeconnect.plugin.mpris DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin mpris)") - -kdeconnect_add_plugin(kdeconnect_mpriscontrol SOURCES ${kdeconnect_mpriscontrol_SRCS} ${debug_file_SRCS}) - if(WIN32) target_link_libraries(kdeconnect_mpriscontrol kdeconnectcore windowsapp) target_compile_features(kdeconnect_mpriscontrol PUBLIC cxx_std_17) diff --git a/plugins/mprisremote/CMakeLists.txt b/plugins/mprisremote/CMakeLists.txt index a1ea1be33..a9d5a70fe 100644 --- a/plugins/mprisremote/CMakeLists.txt +++ b/plugins/mprisremote/CMakeLists.txt @@ -1,12 +1,16 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_mprisremote_debug.h +kdeconnect_add_plugin(kdeconnect_mprisremote) + +target_sources(kdeconnect_mprisremote PRIVATE + mprisremoteplugin.cpp + mprisremoteplayer.cpp + mprisremoteplayermediaplayer2.cpp + mprisremoteplayermediaplayer2player.cpp +) +ecm_qt_declare_logging_category(kdeconnect_mprisremote + HEADER plugin_mprisremote_debug.h IDENTIFIER KDECONNECT_PLUGIN_MPRISREMOTE CATEGORY_NAME kdeconnect.plugin.mprisremote DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin mprisremote)") - -kdeconnect_add_plugin(kdeconnect_mprisremote SOURCES mprisremoteplugin.cpp mprisremoteplayer.cpp mprisremoteplayermediaplayer2.cpp mprisremoteplayermediaplayer2player.cpp ${debug_file_SRCS}) - target_link_libraries(kdeconnect_mprisremote kdeconnectcore Qt::DBus diff --git a/plugins/notifications/CMakeLists.txt b/plugins/notifications/CMakeLists.txt index 246a3292c..e0d0ce42a 100644 --- a/plugins/notifications/CMakeLists.txt +++ b/plugins/notifications/CMakeLists.txt @@ -1,21 +1,12 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_notification_debug.h +kdeconnect_add_plugin(kdeconnect_notifications SOURCES sendreplydialog.cpp notificationsplugin.cpp notification.cpp) + +ki18n_wrap_ui(kdeconnect_notifications sendreplydialog.ui) +ecm_qt_declare_logging_category(kdeconnect_notifications + HEADER plugin_notification_debug.h IDENTIFIER KDECONNECT_PLUGIN_NOTIFICATION CATEGORY_NAME kdeconnect.plugin.notification DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin notification)") -set(kdeconnect_notifications_SRCS - notification.cpp - notificationsplugin.cpp - sendreplydialog.cpp - ${debug_file_SRCS} -) - -ki18n_wrap_ui(kdeconnect_notifications_SRCS sendreplydialog.ui) - -kdeconnect_add_plugin(kdeconnect_notifications SOURCES ${kdeconnect_notifications_SRCS}) - target_link_libraries(kdeconnect_notifications kdeconnectcore Qt::DBus diff --git a/plugins/pausemusic/CMakeLists.txt b/plugins/pausemusic/CMakeLists.txt index 94105c2aa..d8542ddc4 100644 --- a/plugins/pausemusic/CMakeLists.txt +++ b/plugins/pausemusic/CMakeLists.txt @@ -8,17 +8,15 @@ else() ) endif() -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_pausemusic_debug.h +qt_add_dbus_interface(kdeconnect_pausemusic_SRCS org.mpris.MediaPlayer2.Player.xml mprisplayer) + +kdeconnect_add_plugin(kdeconnect_pausemusic SOURCES ${kdeconnect_pausemusic_SRCS}) + +ecm_qt_declare_logging_category(kdeconnect_pausemusic + HEADER plugin_pausemusic_debug.h IDENTIFIER KDECONNECT_PLUGIN_PAUSEMUSIC CATEGORY_NAME kdeconnect.plugin.pausemusic DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin pausemusic)") - -qt_add_dbus_interface(kdeconnect_pausemusic_SRCS org.mpris.MediaPlayer2.Player.xml mprisplayer) - -kdeconnect_add_plugin(kdeconnect_pausemusic SOURCES ${kdeconnect_pausemusic_SRCS} ${debug_file_SRCS}) - target_link_libraries(kdeconnect_pausemusic kdeconnectcore Qt::Core diff --git a/plugins/photo/CMakeLists.txt b/plugins/photo/CMakeLists.txt index a1470bb80..366e4a550 100644 --- a/plugins/photo/CMakeLists.txt +++ b/plugins/photo/CMakeLists.txt @@ -1,17 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_photo_debug.h +kdeconnect_add_plugin(kdeconnect_photo SOURCES photoplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_photo + HEADER plugin_photo_debug.h IDENTIFIER KDECONNECT_PLUGIN_PHOTO CATEGORY_NAME kdeconnect.plugin.photo DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin photo)") - -set(kdeconnect_photo_SRCS - photoplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_photo SOURCES ${kdeconnect_photo_SRCS}) - target_link_libraries(kdeconnect_photo kdeconnectcore Qt::DBus diff --git a/plugins/ping/CMakeLists.txt b/plugins/ping/CMakeLists.txt index 27f4d116e..c9d9b2aba 100644 --- a/plugins/ping/CMakeLists.txt +++ b/plugins/ping/CMakeLists.txt @@ -1,17 +1,11 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_ping_debug.h +kdeconnect_add_plugin(kdeconnect_ping SOURCES pingplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_ping + HEADER plugin_ping_debug.h IDENTIFIER KDECONNECT_PLUGIN_PING CATEGORY_NAME kdeconnect.plugin.ping DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin ping)") -set(kdeconnect_ping_SRCS - pingplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_ping SOURCES ${kdeconnect_ping_SRCS}) - target_link_libraries(kdeconnect_ping kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus diff --git a/plugins/presenter/CMakeLists.txt b/plugins/presenter/CMakeLists.txt index c90cbbc7d..51a7bc36d 100644 --- a/plugins/presenter/CMakeLists.txt +++ b/plugins/presenter/CMakeLists.txt @@ -1,13 +1,12 @@ qt_add_resources(presenter_SRCS assets.qrc) -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_presenter_debug.h +kdeconnect_add_plugin(kdeconnect_presenter SOURCES presenterplugin.cpp ${presenter_SRCS}) +ecm_qt_declare_logging_category(kdeconnect_presenter + HEADER plugin_presenter_debug.h IDENTIFIER KDECONNECT_PLUGIN_PRESENT CATEGORY_NAME kdeconnect.plugin.presenter DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin presenter)") -kdeconnect_add_plugin(kdeconnect_presenter SOURCES presenterplugin.cpp ${presenter_SRCS} ${debug_file_SRCS}) target_link_libraries(kdeconnect_presenter kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus diff --git a/plugins/remotecommands/CMakeLists.txt b/plugins/remotecommands/CMakeLists.txt index 828bd8838..c5658204b 100644 --- a/plugins/remotecommands/CMakeLists.txt +++ b/plugins/remotecommands/CMakeLists.txt @@ -1,16 +1,11 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_remotecommands_debug.h +kdeconnect_add_plugin(kdeconnect_remotecommands SOURCES remotecommandsplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_remotecommands + HEADER plugin_remotecommands_debug.h IDENTIFIER KDECONNECT_PLUGIN_REMOTECOMMANDS CATEGORY_NAME kdeconnect.plugin.remotecommands DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotecommands)") - -kdeconnect_add_plugin(kdeconnect_remotecommands - SOURCES remotecommandsplugin.cpp ${debug_file_SRCS} -) - - target_link_libraries(kdeconnect_remotecommands kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus - ) +) diff --git a/plugins/remotecontrol/CMakeLists.txt b/plugins/remotecontrol/CMakeLists.txt index bf93accb1..f70a94c5d 100644 --- a/plugins/remotecontrol/CMakeLists.txt +++ b/plugins/remotecontrol/CMakeLists.txt @@ -1,12 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_remotecontrol_debug.h +kdeconnect_add_plugin(kdeconnect_remotecontrol SOURCES remotecontrolplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_remotecontrol + HEADER plugin_remotecontrol_debug.h IDENTIFIER KDECONNECT_PLUGIN_REMOTECONTROL CATEGORY_NAME kdeconnect.plugin.remotecontrol DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotecontrol)") - -kdeconnect_add_plugin(kdeconnect_remotecontrol SOURCES remotecontrolplugin.cpp ${debug_file_SRCS}) - target_link_libraries(kdeconnect_remotecontrol kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus diff --git a/plugins/remotekeyboard/CMakeLists.txt b/plugins/remotekeyboard/CMakeLists.txt index 7d6465bdf..be4bb7883 100644 --- a/plugins/remotekeyboard/CMakeLists.txt +++ b/plugins/remotekeyboard/CMakeLists.txt @@ -1,13 +1,11 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_remotekeyboard_debug.h +kdeconnect_add_plugin(kdeconnect_remotekeyboard SOURCES remotekeyboardplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_remotekeyboard + HEADER plugin_remotekeyboard_debug.h IDENTIFIER KDECONNECT_PLUGIN_REMOTEKEYBOARD CATEGORY_NAME kdeconnect.plugin.remotekeyboard DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotekeyboard)") -kdeconnect_add_plugin(kdeconnect_remotekeyboard - SOURCES remotekeyboardplugin.cpp ${debug_file_SRCS}) - target_link_libraries(kdeconnect_remotekeyboard kdeconnectcore Qt::DBus diff --git a/plugins/remotesystemvolume/CMakeLists.txt b/plugins/remotesystemvolume/CMakeLists.txt index f7066fdab..6a77a4e71 100644 --- a/plugins/remotesystemvolume/CMakeLists.txt +++ b/plugins/remotesystemvolume/CMakeLists.txt @@ -1,17 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_remotesystemvolume_debug.h +kdeconnect_add_plugin(kdeconnect_remotesystemvolume SOURCES remotesystemvolumeplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_remotesystemvolume + HEADER plugin_remotesystemvolume_debug.h IDENTIFIER KDECONNECT_PLUGIN_REMOTESYSTEMVOLUME CATEGORY_NAME kdeconnect.plugin.remotesystemvolume DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotesystemvolume)") - -set(kdeconnect_remotesystemvolume_SRCS - remotesystemvolumeplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_remotesystemvolume SOURCES ${kdeconnect_remotesystemvolume_SRCS}) - target_link_libraries(kdeconnect_remotesystemvolume kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus diff --git a/plugins/runcommand/CMakeLists.txt b/plugins/runcommand/CMakeLists.txt index 6f4788a2f..3bf00e827 100644 --- a/plugins/runcommand/CMakeLists.txt +++ b/plugins/runcommand/CMakeLists.txt @@ -1,17 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_runcommand_debug.h +kdeconnect_add_plugin(kdeconnect_runcommand SOURCES runcommandplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_runcommand + HEADER plugin_runcommand_debug.h IDENTIFIER KDECONNECT_PLUGIN_RUNCOMMAND CATEGORY_NAME kdeconnect.plugin.runcommand DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin runcommand)") - -set(kdeconnect_runcommand_SRCS - runcommandplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_runcommand SOURCES ${kdeconnect_runcommand_SRCS}) - target_link_libraries(kdeconnect_runcommand kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus diff --git a/plugins/screensaver-inhibit/CMakeLists.txt b/plugins/screensaver-inhibit/CMakeLists.txt index cc054554a..418e5e7ac 100644 --- a/plugins/screensaver-inhibit/CMakeLists.txt +++ b/plugins/screensaver-inhibit/CMakeLists.txt @@ -13,15 +13,14 @@ else() qt_add_dbus_interface(kdeconnect_screensaver_inhibit_SRCS org.freedesktop.ScreenSaver.xml screensaverinterface) endif() -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER kdeconnect_screensaverinhibit_debug.h + +kdeconnect_add_plugin(kdeconnect_screensaver_inhibit SOURCES ${kdeconnect_screensaver_inhibit_SRCS}) + +ecm_qt_declare_logging_category(kdeconnect_screensaver_inhibit + HEADER kdeconnect_screensaverinhibit_debug.h IDENTIFIER KDECONNECT_PLUGIN_SCREENSAVERINHIBIT CATEGORY_NAME kdeconnect.plugin.screensaverinhibit DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin screensaverinhibit)") - -kdeconnect_add_plugin(kdeconnect_screensaver_inhibit SOURCES ${kdeconnect_screensaver_inhibit_SRCS} ${debug_file_SRCS}) - target_link_libraries(kdeconnect_screensaver_inhibit kdeconnectcore) if(NOT APPLE AND NOT WIN32) target_link_libraries(kdeconnect_screensaver_inhibit diff --git a/plugins/sendnotifications/CMakeLists.txt b/plugins/sendnotifications/CMakeLists.txt index 890255b06..b875360df 100644 --- a/plugins/sendnotifications/CMakeLists.txt +++ b/plugins/sendnotifications/CMakeLists.txt @@ -1,20 +1,16 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_sendnotification_debug.h - IDENTIFIER KDECONNECT_PLUGIN_SENDNOTIFICATION CATEGORY_NAME kdeconnect.plugin.sendnotification - DEFAULT_SEVERITY Warning - EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sendnotification)") +kdeconnect_add_plugin(kdeconnect_sendnotifications) -set(kdeconnect_sendnotifications_SRCS +target_sources(kdeconnect_sendnotifications PRIVATE sendnotificationsplugin.cpp notificationslistener.cpp notifyingapplication.cpp - ${debug_file_SRCS} ) - -kdeconnect_add_plugin(kdeconnect_sendnotifications SOURCES ${kdeconnect_sendnotifications_SRCS}) - +ecm_qt_declare_logging_category(kdeconnect_sendnotifications + HEADER plugin_sendnotification_debug.h + IDENTIFIER KDECONNECT_PLUGIN_SENDNOTIFICATION CATEGORY_NAME kdeconnect.plugin.sendnotification + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sendnotification)") target_link_libraries(kdeconnect_sendnotifications kdeconnectcore Qt::DBus @@ -25,9 +21,7 @@ target_link_libraries(kdeconnect_sendnotifications PkgConfig::GIO ) -####################################### # Config - kcoreaddons_add_plugin(kdeconnect_sendnotifications_config INSTALL_NAMESPACE "kdeconnect/kcms") ki18n_wrap_ui(kdeconnect_sendnotifications_config sendnotifications_config.ui) @@ -37,7 +31,7 @@ target_sources(kdeconnect_sendnotifications_config PRIVATE notifyingapplicationmodel.cpp ) -target_link_libraries( kdeconnect_sendnotifications_config +target_link_libraries(kdeconnect_sendnotifications_config kdeconnectcore kdeconnectpluginkcm KF${QT_MAJOR_VERSION}::I18n diff --git a/plugins/sftp/CMakeLists.txt b/plugins/sftp/CMakeLists.txt index 519b678be..a83de2490 100644 --- a/plugins/sftp/CMakeLists.txt +++ b/plugins/sftp/CMakeLists.txt @@ -14,15 +14,13 @@ else() ) endif() -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_sftp_debug.h +kdeconnect_add_plugin(kdeconnect_sftp SOURCES ${kdeconnect_sftp_SRCS}) +ecm_qt_declare_logging_category(kdeconnect_sftp + HEADER plugin_sftp_debug.h IDENTIFIER KDECONNECT_PLUGIN_SFTP CATEGORY_NAME kdeconnect.plugin.sftp DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sftp)") -kdeconnect_add_plugin(kdeconnect_sftp SOURCES ${kdeconnect_sftp_SRCS} ${debug_file_SRCS}) - target_link_libraries(kdeconnect_sftp kdeconnectcore Qt::DBus diff --git a/plugins/share/CMakeLists.txt b/plugins/share/CMakeLists.txt index 87d6f205b..6e57825ba 100644 --- a/plugins/share/CMakeLists.txt +++ b/plugins/share/CMakeLists.txt @@ -1,5 +1,6 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category(debug_file_SRCS +kdeconnect_add_plugin(kdeconnect_share SOURCES shareplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_share HEADER plugin_share_debug.h IDENTIFIER KDECONNECT_PLUGIN_SHARE CATEGORY_NAME kdeconnect.plugin.share @@ -7,14 +8,6 @@ ecm_qt_declare_logging_category(debug_file_SRCS EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin share)" ) - -set(kdeconnect_share_SRCS - shareplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_share SOURCES ${kdeconnect_share_SRCS}) - target_link_libraries(kdeconnect_share kdeconnectcore Qt::DBus diff --git a/plugins/sms/CMakeLists.txt b/plugins/sms/CMakeLists.txt index 5ae050d17..85e926b01 100644 --- a/plugins/sms/CMakeLists.txt +++ b/plugins/sms/CMakeLists.txt @@ -1,25 +1,22 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_sms_debug.h +kdeconnect_add_plugin(kdeconnect_sms SOURCES ${kdeconnect_sms_SRCS}) + +target_sources(kdeconnect_sms PRIVATE + smsplugin.cpp + conversationsdbusinterface.cpp + requestconversationworker.cpp +) +ecm_qt_declare_logging_category(kdeconnect_sms + HEADER plugin_sms_debug.h IDENTIFIER KDECONNECT_PLUGIN_SMS CATEGORY_NAME kdeconnect.plugin.sms DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sms)") -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER kdeconnect_conversations_debug.h +ecm_qt_declare_logging_category(kdeconnect_sms + HEADER kdeconnect_conversations_debug.h IDENTIFIER KDECONNECT_CONVERSATIONS CATEGORY_NAME kdeconnect.conversations DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (conversations)") -set(kdeconnect_sms_SRCS - smsplugin.cpp - conversationsdbusinterface.cpp - requestconversationworker.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_sms SOURCES ${kdeconnect_sms_SRCS}) - target_link_libraries(kdeconnect_sms kdeconnectcore kdeconnectinterfaces diff --git a/plugins/systemvolume/CMakeLists.txt b/plugins/systemvolume/CMakeLists.txt index b3b2af77e..557f54b6f 100644 --- a/plugins/systemvolume/CMakeLists.txt +++ b/plugins/systemvolume/CMakeLists.txt @@ -12,14 +12,13 @@ else() ) endif() -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_systemvolume_debug.h +kdeconnect_add_plugin(kdeconnect_systemvolume SOURCES ${kdeconnect_systemvolume_SRCS}) + +ecm_qt_declare_logging_category(kdeconnect_systemvolume + HEADER plugin_systemvolume_debug.h IDENTIFIER KDECONNECT_PLUGIN_SYSTEMVOLUME CATEGORY_NAME kdeconnect.plugin.systemvolume DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin systemvolume)") -kdeconnect_add_plugin(kdeconnect_systemvolume SOURCES ${kdeconnect_systemvolume_SRCS} ${debug_file_SRCS}) - if(WIN32) target_link_libraries(kdeconnect_systemvolume kdeconnectcore diff --git a/plugins/telephony/CMakeLists.txt b/plugins/telephony/CMakeLists.txt index 559e1c703..dd17032fa 100644 --- a/plugins/telephony/CMakeLists.txt +++ b/plugins/telephony/CMakeLists.txt @@ -1,17 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_telephony_debug.h +kdeconnect_add_plugin(kdeconnect_telephony SOURCES telephonyplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_telephony + HEADER plugin_telephony_debug.h IDENTIFIER KDECONNECT_PLUGIN_TELEPHONY CATEGORY_NAME kdeconnect.plugin.telephony DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin telephony)") - -set(kdeconnect_telephony_SRCS - telephonyplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_telephony SOURCES ${kdeconnect_telephony_SRCS}) - target_link_libraries(kdeconnect_telephony kdeconnectcore KF${QT_MAJOR_VERSION}::I18n diff --git a/plugins/virtualmonitor/CMakeLists.txt b/plugins/virtualmonitor/CMakeLists.txt index f1d73a180..5ed62e1be 100644 --- a/plugins/virtualmonitor/CMakeLists.txt +++ b/plugins/virtualmonitor/CMakeLists.txt @@ -1,18 +1,10 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_virtualmonitor_debug.h +kdeconnect_add_plugin(kdeconnect_virtualmonitor SOURCES virtualmonitorplugin.cpp) +ecm_qt_declare_logging_category(kdeconnect_virtualmonitor + HEADER plugin_virtualmonitor_debug.h IDENTIFIER KDECONNECT_PLUGIN_VIRTUALMONITOR CATEGORY_NAME kdeconnect.plugin.virtualmonitor DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin virtualmonitor)") -set(kdeconnect_virtualmonitor_SRCS - virtualmonitorplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_virtualmonitor - SOURCES ${kdeconnect_virtualmonitor_SRCS}) - target_link_libraries(kdeconnect_virtualmonitor kdeconnectcore Qt::Core diff --git a/smsapp/CMakeLists.txt b/smsapp/CMakeLists.txt index 35cf79ab7..345f37f21 100644 --- a/smsapp/CMakeLists.txt +++ b/smsapp/CMakeLists.txt @@ -1,28 +1,24 @@ -set(smshelper_debug_file_SRCS) -ecm_qt_declare_logging_category( - smshelper_debug_file_SRCS HEADER smshelper_debug.h +add_library(kdeconnectsmshelper STATIC + smshelper.cpp + gsmasciimap.cpp +) + +ecm_qt_declare_logging_category(kdeconnectsmshelper + HEADER smshelper_debug.h IDENTIFIER KDECONNECT_SMS_SMSHELPER CATEGORY_NAME kdeconnect.sms.smshelper DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (smshelper)") - -set(sms_debug_files_SRCS) -ecm_qt_declare_logging_category( - sms_debug_files_SRCS HEADER sms_conversation_debug.h +ecm_qt_declare_logging_category(kdeconnectsmshelper + HEADER sms_conversation_debug.h IDENTIFIER KDECONNECT_SMS_CONVERSATION_MODEL CATEGORY_NAME kdeconnect.sms.conversation DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (sms conversation model)") - -ecm_qt_declare_logging_category( - sms_debug_files_SRCS HEADER sms_conversations_list_debug.h +ecm_qt_declare_logging_category(kdeconnectsmshelper + HEADER sms_conversations_list_debug.h IDENTIFIER KDECONNECT_SMS_CONVERSATIONS_LIST_MODEL CATEGORY_NAME kdeconnect.sms.conversations_list DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (sms conversations list)") -add_library(kdeconnectsmshelper STATIC - smshelper.cpp - gsmasciimap.cpp - ${smshelper_debug_file_SRCS} -) target_include_directories(kdeconnectsmshelper PUBLIC ${CMAKE_SOURCE_DIR}) @@ -46,7 +42,7 @@ add_executable(kdeconnect-sms thumbnailsprovider.cpp attachmentinfo.cpp ${kdeconnect_custom_icons_SRCS} - ${sms_debug_files_SRCS}) +) target_link_libraries(kdeconnect-sms kdeconnectsmshelper