From d4026861ab912588f65ce32d2a5ba2efbad4e8d9 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 30 Apr 2019 19:03:24 +0200 Subject: [PATCH] Clean up includes --- CMakeLists.txt | 3 --- cli/CMakeLists.txt | 2 ++ core/CMakeLists.txt | 4 +++- core/backends/devicelink.h | 2 +- core/backends/linkprovider.h | 2 +- daemon/CMakeLists.txt | 1 + indicator/CMakeLists.txt | 1 + interfaces/CMakeLists.txt | 2 ++ interfaces/conversationmessage.h | 2 +- interfaces/dbusinterfaces.h | 34 ++++++++++++++-------------- interfaces/devicesmodel.h | 2 +- interfaces/devicessortproxymodel.cpp | 4 ++-- interfaces/devicessortproxymodel.h | 2 +- interfaces/notificationsmodel.h | 2 +- interfaces/remotecommandsmodel.h | 2 +- interfaces/remotesinksmodel.h | 2 +- tests/CMakeLists.txt | 1 + urlhandler/CMakeLists.txt | 2 ++ 18 files changed, 39 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 550eea369..56b541895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,6 @@ set_package_properties(KF5Kirigami2 PROPERTIES TYPE RUNTIME ) -include_directories(${CMAKE_SOURCE_DIR}) - configure_file(kdeconnect-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h) include(KDEInstallDirs) @@ -72,7 +70,6 @@ include(FeatureSummary) include(KDEConnectMacros.cmake) include(GenerateExportHeader) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_subdirectory(core) if(NOT SAILFISHOS) diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 6b887f004..8b0270f28 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -3,6 +3,8 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-cli\") add_executable(kdeconnect-cli kdeconnect-cli.cpp) ecm_mark_nongui_executable(kdeconnect-cli) +target_include_directories(kdeconnect-cli PUBLIC ${CMAKE_BINARY_DIR}) + target_link_libraries(kdeconnect-cli kdeconnectinterfaces KF5::CoreAddons diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 6d347ca70..f361f0175 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -39,6 +39,9 @@ set(kdeconnectcore_SRCS ) add_library(kdeconnectcore ${kdeconnectcore_SRCS}) + +target_include_directories(kdeconnectcore PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) + target_link_libraries(kdeconnectcore PUBLIC Qt5::Network @@ -65,7 +68,6 @@ set_target_properties(kdeconnectcore PROPERTIES SOVERSION ${KDECONNECT_VERSION_MAJOR} ) -target_include_directories(kdeconnectcore PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) generate_export_header(kdeconnectcore EXPORT_FILE_NAME kdeconnectcore_export.h BASE_NAME KDEConnectCore) install(TARGETS kdeconnectcore EXPORT kdeconnectLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) diff --git a/core/backends/devicelink.h b/core/backends/devicelink.h index 992cb0322..c11c27966 100644 --- a/core/backends/devicelink.h +++ b/core/backends/devicelink.h @@ -23,7 +23,7 @@ #include -#include "core/networkpacket.h" +#include "networkpacket.h" class PairingHandler; class NetworkPacket; diff --git a/core/backends/linkprovider.h b/core/backends/linkprovider.h index 00000502d..9ee6c93bc 100644 --- a/core/backends/linkprovider.h +++ b/core/backends/linkprovider.h @@ -23,7 +23,7 @@ #include -#include "core/networkpacket.h" +#include "networkpacket.h" #include "pairinghandler.h" class DeviceLink; diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 5ef993825..ab0696bf0 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -3,6 +3,7 @@ project(kdeconnectd) add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kded") add_executable(kdeconnectd kdeconnectd.cpp) +target_include_directories(kdeconnectd PUBLIC ${CMAKE_BINARY_DIR}) target_link_libraries(kdeconnectd kdeconnectcore KF5::KIOWidgets KF5::DBusAddons KF5::Notifications KF5::I18n Qt5::Widgets) ecm_mark_nongui_executable(kdeconnectd) diff --git a/indicator/CMakeLists.txt b/indicator/CMakeLists.txt index ae1a4d348..5847ba7e5 100644 --- a/indicator/CMakeLists.txt +++ b/indicator/CMakeLists.txt @@ -15,6 +15,7 @@ ecm_add_app_icon(indicator_SRCS ICONS ) add_executable(kdeconnect-indicator ${indicator_SRCS}) +target_include_directories(kdeconnect-indicator PUBLIC ${CMAKE_BINARY_DIR}) target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications KF5::DBusAddons KF5::KCMUtils kdeconnectinterfaces) install(TARGETS kdeconnect-indicator ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt index 16cd51daa..ab642b311 100644 --- a/interfaces/CMakeLists.txt +++ b/interfaces/CMakeLists.txt @@ -64,6 +64,8 @@ set_target_properties(kdeconnectinterfaces PROPERTIES generate_export_header(kdeconnectinterfaces EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterfaces_export.h BASE_NAME KDEConnectInterfaces) +target_include_directories(kdeconnectinterfaces PUBLIC ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries(kdeconnectinterfaces LINK_PUBLIC Qt5::Gui diff --git a/interfaces/conversationmessage.h b/interfaces/conversationmessage.h index 555751ae6..7c60141bf 100644 --- a/interfaces/conversationmessage.h +++ b/interfaces/conversationmessage.h @@ -23,7 +23,7 @@ #include -#include "interfaces/kdeconnectinterfaces_export.h" +#include "kdeconnectinterfaces_export.h" class KDECONNECTINTERFACES_EXPORT ConversationMessage { diff --git a/interfaces/dbusinterfaces.h b/interfaces/dbusinterfaces.h index fcc64b729..99ca6139c 100644 --- a/interfaces/dbusinterfaces.h +++ b/interfaces/dbusinterfaces.h @@ -21,24 +21,24 @@ #ifndef DBUSINTERFACES_H #define DBUSINTERFACES_H -#include "interfaces/kdeconnectinterfaces_export.h" +#include "kdeconnectinterfaces_export.h" -#include "interfaces/daemoninterface.h" -#include "interfaces/deviceinterface.h" -#include "interfaces/devicebatteryinterface.h" -#include "interfaces/devicesftpinterface.h" -#include "interfaces/devicefindmyphoneinterface.h" -#include "interfaces/devicenotificationsinterface.h" -#include "interfaces/notificationinterface.h" -#include "interfaces/mprisremoteinterface.h" -#include "interfaces/remotecontrolinterface.h" -#include "interfaces/lockdeviceinterface.h" -#include "interfaces/remotecommandsinterface.h" -#include "interfaces/remotekeyboardinterface.h" -#include "interfaces/smsinterface.h" -#include "interfaces/conversationsinterface.h" -#include "interfaces/shareinterface.h" -#include "interfaces/remotesystemvolumeinterface.h" +#include "daemoninterface.h" +#include "deviceinterface.h" +#include "devicebatteryinterface.h" +#include "devicesftpinterface.h" +#include "devicefindmyphoneinterface.h" +#include "devicenotificationsinterface.h" +#include "notificationinterface.h" +#include "mprisremoteinterface.h" +#include "remotecontrolinterface.h" +#include "lockdeviceinterface.h" +#include "remotecommandsinterface.h" +#include "remotekeyboardinterface.h" +#include "smsinterface.h" +#include "conversationsinterface.h" +#include "shareinterface.h" +#include "remotesystemvolumeinterface.h" /** * Using these "proxy" classes just in case we need to rename the diff --git a/interfaces/devicesmodel.h b/interfaces/devicesmodel.h index e8512340c..dcd0c946f 100644 --- a/interfaces/devicesmodel.h +++ b/interfaces/devicesmodel.h @@ -25,7 +25,7 @@ #include #include -#include "interfaces/kdeconnectinterfaces_export.h" +#include "kdeconnectinterfaces_export.h" class QDBusPendingCallWatcher; class DaemonDbusInterface; diff --git a/interfaces/devicessortproxymodel.cpp b/interfaces/devicessortproxymodel.cpp index 425dd4f80..55d616c93 100644 --- a/interfaces/devicessortproxymodel.cpp +++ b/interfaces/devicessortproxymodel.cpp @@ -20,8 +20,8 @@ #include "devicessortproxymodel.h" -#include -#include +#include "dbusinterfaces.h" +#include "devicesmodel.h" DevicesSortProxyModel::DevicesSortProxyModel(DevicesModel* devicesModel) : QSortFilterProxyModel(devicesModel) diff --git a/interfaces/devicessortproxymodel.h b/interfaces/devicessortproxymodel.h index df79b7c04..a342c2e2c 100644 --- a/interfaces/devicessortproxymodel.h +++ b/interfaces/devicessortproxymodel.h @@ -22,7 +22,7 @@ #define DEVICESSORTPROXYMODEL_H #include -#include "interfaces/kdeconnectinterfaces_export.h" +#include "kdeconnectinterfaces_export.h" class DevicesModel; diff --git a/interfaces/notificationsmodel.h b/interfaces/notificationsmodel.h index dd0ac9083..e08498da3 100644 --- a/interfaces/notificationsmodel.h +++ b/interfaces/notificationsmodel.h @@ -26,7 +26,7 @@ #include #include -#include "interfaces/dbusinterfaces.h" +#include "dbusinterfaces.h" class KDECONNECTINTERFACES_EXPORT NotificationsModel : public QAbstractListModel diff --git a/interfaces/remotecommandsmodel.h b/interfaces/remotecommandsmodel.h index ecef9af30..e9266eee9 100644 --- a/interfaces/remotecommandsmodel.h +++ b/interfaces/remotecommandsmodel.h @@ -23,7 +23,7 @@ #include -#include "interfaces/dbusinterfaces.h" +#include "dbusinterfaces.h" struct Command { QString key; diff --git a/interfaces/remotesinksmodel.h b/interfaces/remotesinksmodel.h index 3c0e256ad..24baf68fe 100644 --- a/interfaces/remotesinksmodel.h +++ b/interfaces/remotesinksmodel.h @@ -23,7 +23,7 @@ #include -#include "interfaces/dbusinterfaces.h" +#include "dbusinterfaces.h" struct Sink { QString name; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0a5b86798..f81dace99 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,6 +3,7 @@ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test) include_directories( ${KDEConnectCore_BINARY_DIR} ${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/plugins/sendnotifications/ ) diff --git a/urlhandler/CMakeLists.txt b/urlhandler/CMakeLists.txt index 0e38edc6a..6009d3834 100644 --- a/urlhandler/CMakeLists.txt +++ b/urlhandler/CMakeLists.txt @@ -2,6 +2,8 @@ ki18n_wrap_ui(telhandler_SRCS dialog.ui) add_executable(kdeconnect-handler kdeconnect-handler.cpp ${telhandler_SRCS}) +target_include_directories(kdeconnect-handler PUBLIC ${CMAKE_BINARY_DIR}) + target_link_libraries(kdeconnect-handler kdeconnectinterfaces Qt5::Widgets