From 9fdc2901b2f7baa927306d1ee9928f15bdab3c4c Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Thu, 20 Jul 2023 16:59:37 +0300 Subject: [PATCH] Use target-centric CMake approach rest of logging categories --- interfaces/CMakeLists.txt | 28 +++++++++---------- plugins/clipboard/CMakeLists.txt | 12 ++++---- plugins/findthisdevice/CMakeLists.txt | 19 ++++--------- plugins/findthisdevice/findthisdeviceplugin.h | 2 -- 4 files changed, 25 insertions(+), 36 deletions(-) diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt index aa7d81e43..28dce2eca 100644 --- a/interfaces/CMakeLists.txt +++ b/interfaces/CMakeLists.txt @@ -10,19 +10,6 @@ function(geninterface source_h output_h) set(libkdeconnect_SRC ${libkdeconnect_SRC} PARENT_SCOPE) endfunction() -set(debug_files_SRCS) -ecm_qt_declare_logging_category( - debug_files_SRCS HEADER interfaces_conversation_message_debug.h - IDENTIFIER CONVERSATION_MESSAGE_LOGGING_CATEGORY CATEGORY_NAME kdeconnect.interfaces.conversationmessage - DEFAULT_SEVERITY Warning - EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (conversation message)") - -ecm_qt_declare_logging_category( - debug_files_SRCS HEADER interfaces_debug.h - IDENTIFIER KDECONNECT_INTERFACES CATEGORY_NAME kdeconnect.interfaces - DEFAULT_SEVERITY Warning - EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (interfaces)") - set(libkdeconnect_SRC dbusinterfaces.cpp devicesmodel.cpp @@ -34,8 +21,6 @@ set(libkdeconnect_SRC devicespluginfilterproxymodel.cpp pluginmodel.cpp commandsmodel.cpp -# modeltest.cpp - ${debug_files_SRCS} ) geninterface(${PROJECT_SOURCE_DIR}/core/daemon.h daemoninterface) @@ -68,6 +53,19 @@ else() endif() target_sources(kdeconnectinterfaces PRIVATE ${libkdeconnect_SRC}) +ecm_qt_declare_logging_category(kdeconnectinterfaces + HEADER interfaces_conversation_message_debug.h + IDENTIFIER CONVERSATION_MESSAGE_LOGGING_CATEGORY CATEGORY_NAME kdeconnect.interfaces.conversationmessage + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (conversation message)") + +ecm_qt_declare_logging_category(kdeconnectinterfaces + HEADER interfaces_debug.h + IDENTIFIER KDECONNECT_INTERFACES CATEGORY_NAME kdeconnect.interfaces + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (interfaces)") + + set_target_properties(kdeconnectinterfaces PROPERTIES VERSION ${KDECONNECT_VERSION} SOVERSION ${KDECONNECT_VERSION_MAJOR} diff --git a/plugins/clipboard/CMakeLists.txt b/plugins/clipboard/CMakeLists.txt index 22ddbae58..1359f3c23 100644 --- a/plugins/clipboard/CMakeLists.txt +++ b/plugins/clipboard/CMakeLists.txt @@ -1,11 +1,11 @@ -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_clipboard_debug.h +kdeconnect_add_plugin(kdeconnect_clipboard SOURCES clipboardplugin.cpp clipboardlistener.cpp) + +ecm_qt_declare_logging_category(kdeconnect_clipboard + HEADER plugin_clipboard_debug.h IDENTIFIER KDECONNECT_PLUGIN_CLIPBOARD CATEGORY_NAME kdeconnect.plugin.clipboard DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin clipboard)") -kdeconnect_add_plugin(kdeconnect_clipboard SOURCES clipboardplugin.cpp clipboardlistener.cpp ${debug_file_SRCS}) - target_link_libraries(kdeconnect_clipboard kdeconnectcore KF${QT_MAJOR_VERSION}::GuiAddons Qt${QT_MAJOR_VERSION}::DBus @@ -15,8 +15,8 @@ target_link_libraries(kdeconnect_clipboard kdeconnectcore kcoreaddons_add_plugin(kdeconnect_clipboard_config INSTALL_NAMESPACE "kdeconnect/kcms") ki18n_wrap_ui(kdeconnect_clipboard_config clipboard_config.ui) -target_sources(kdeconnect_clipboard_config PRIVATE clipboard_config.cpp ${debug_file_SRCS}) -target_link_libraries( kdeconnect_clipboard_config +target_sources(kdeconnect_clipboard_config PRIVATE clipboard_config.cpp) +target_link_libraries(kdeconnect_clipboard_config kdeconnectcore kdeconnectpluginkcm KF${QT_MAJOR_VERSION}::I18n diff --git a/plugins/findthisdevice/CMakeLists.txt b/plugins/findthisdevice/CMakeLists.txt index af5c38970..4ed58484c 100644 --- a/plugins/findthisdevice/CMakeLists.txt +++ b/plugins/findthisdevice/CMakeLists.txt @@ -1,18 +1,11 @@ -set(debug_file_SRCS) -ecm_qt_declare_logging_category( - debug_file_SRCS HEADER plugin_findthisdevice_debug.h +kdeconnect_add_plugin(kdeconnect_findthisdevice SOURCES findthisdeviceplugin.cpp) + +ecm_qt_declare_logging_category(kdeconnect_findthisdevice + HEADER plugin_findthisdevice_debug.h IDENTIFIER KDECONNECT_PLUGIN_FINDTHISDEVICE CATEGORY_NAME kdeconnect.plugin.findthisdevice DEFAULT_SEVERITY Warning EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin findthisdevice)") -set(kdeconnect_findthisdevice_SRCS - findthisdeviceplugin.cpp - ${debug_file_SRCS} -) - -kdeconnect_add_plugin(kdeconnect_findthisdevice - SOURCES ${kdeconnect_findthisdevice_SRCS}) - target_link_libraries(kdeconnect_findthisdevice kdeconnectcore Qt::Core @@ -29,12 +22,12 @@ endif() kcoreaddons_add_plugin(kdeconnect_findthisdevice_config INSTALL_NAMESPACE "kdeconnect/kcms") ki18n_wrap_ui(kdeconnect_findthisdevice_config findthisdevice_config.ui) -target_sources(kdeconnect_findthisdevice_config PRIVATE findthisdevice_config.cpp ${debug_file_SRCS}) +target_sources(kdeconnect_findthisdevice_config PRIVATE findthisdevice_config.cpp) target_link_libraries(kdeconnect_findthisdevice_config kdeconnectpluginkcm Qt::Multimedia KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::ConfigWidgets - KF${QT_MAJOR_VERSION}::KIOWidgets # KUrlRequester + KF${QT_MAJOR_VERSION}::KIOWidgets # KUrlRequester ) diff --git a/plugins/findthisdevice/findthisdeviceplugin.h b/plugins/findthisdevice/findthisdeviceplugin.h index 1e9765328..197b50205 100644 --- a/plugins/findthisdevice/findthisdeviceplugin.h +++ b/plugins/findthisdevice/findthisdeviceplugin.h @@ -19,8 +19,6 @@ #include #include #endif -// Qt -#include "plugin_findthisdevice_debug.h" #define PACKET_TYPE_FINDMYPHONE_REQUEST QStringLiteral("kdeconnect.findmyphone.request")