CMake cleanup

Remove all include_directory calls

They are either unnecessary or can be done better
This commit is contained in:
Nicolas Fella 2020-11-16 01:16:03 +01:00
parent 29a5136c7b
commit 8b82a30d40
10 changed files with 12 additions and 43 deletions

View file

@ -1,17 +1,9 @@
include_directories(${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR})
set(kdeconnectdeclarativeplugin_SRC
add_library(kdeconnectdeclarativeplugin SHARED
kdeconnectdeclarativeplugin.cpp
responsewaiter.cpp
objectfactory.cpp
resources.qrc
)
qt5_add_resources(kdeconnectdeclarativeplugin_SRC resources.qrc)
add_library(kdeconnectdeclarativeplugin SHARED ${kdeconnectdeclarativeplugin_SRC})
target_link_libraries(kdeconnectdeclarativeplugin
Qt5::Qml
kdeconnectinterfaces

View file

@ -1,10 +1,5 @@
add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kcm")
include_directories(${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR})
set(kcm_SRCS
kcm.cpp
)
@ -19,6 +14,7 @@ target_link_libraries(kcm_kdeconnect
KF5::I18n
KF5::KCMUtils
kdeconnectinterfaces
kdeconnectversion
)
install(TARGETS kcm_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})

View file

@ -13,8 +13,8 @@
#include <kcmutils_version.h>
#include "ui_kcm.h"
#include "interfaces/dbusinterfaces.h"
#include "interfaces/devicesmodel.h"
#include "dbusinterfaces.h"
#include "devicesmodel.h"
#include "devicessortproxymodel.h"
#include "kdeconnect-version.h"

View file

@ -1,4 +1,3 @@
include_directories(${CMAKE_SOURCE_DIR})
add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kio")
set(debug_file_SRCS)

View file

@ -11,7 +11,7 @@
#include <kio/slavebase.h>
#include "interfaces/dbusinterfaces.h"
#include "dbusinterfaces.h"
class KioKdeconnect : public QObject, public KIO::SlaveBase
{

View file

@ -1,4 +1,3 @@
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/core)
add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-plugins\")
install(FILES kdeconnect_plugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})

View file

@ -1,3 +1,5 @@
kdeconnect_add_plugin(kdeconnect_mousepad JSON kdeconnect_mousepad.json SOURCES mousepadplugin.cpp abstractremoteinput.cpp)
if(UNIX AND NOT APPLE)
find_package(KF5 ${KF5_MIN_VERSION} QUIET OPTIONAL_COMPONENTS Wayland)
@ -11,7 +13,7 @@ if(UNIX AND NOT APPLE)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
find_package(XTest REQUIRED)
find_package(X11 REQUIRED)
include_directories(${XTEST_INCLUDE_DIRS} ${X11_INCLUDE_DIR} ${LibFakeKey_INCLUDE_DIRS})
target_include_directories(kdeconnect_mousepad ${XTEST_INCLUDE_DIRS} ${X11_INCLUDE_DIR} ${LibFakeKey_INCLUDE_DIRS})
endif()
endif()
@ -21,10 +23,8 @@ set(HAVE_WAYLAND ${KF5Wayland_FOUND})
set(HAVE_MACOS ${APPLE})
configure_file(config-mousepad.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-mousepad.h )
kdeconnect_add_plugin(kdeconnect_mousepad JSON kdeconnect_mousepad.json SOURCES mousepadplugin.cpp abstractremoteinput.cpp)
target_link_libraries(kdeconnect_mousepad kdeconnectcore Qt5::Gui KF5::I18n)
if (HAVE_WINDOWS)
target_sources(kdeconnect_mousepad PUBLIC windowsremoteinput.cpp)
endif()

View file

@ -10,8 +10,6 @@ set(kdeconnect_telephony_SRCS
${debug_file_SRCS}
)
include_directories(${CMAKE_BINARY_DIR})
kdeconnect_add_plugin(kdeconnect_telephony JSON kdeconnect_telephony.json SOURCES ${kdeconnect_telephony_SRCS})
target_link_libraries(kdeconnect_telephony

View file

@ -1,9 +1,7 @@
add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-settings")
include_directories(${CMAKE_BINARY_DIR})
add_executable(kdeconnect-settings main.cpp)
target_link_libraries(kdeconnect-settings KF5::I18n KF5::KCMUtils KF5::DBusAddons)
target_link_libraries(kdeconnect-settings kdeconnectversion KF5::I18n KF5::KCMUtils KF5::DBusAddons)
install(TARGETS kdeconnect-settings ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES org.kde.kdeconnect.settings.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})

View file

@ -1,31 +1,18 @@
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/..
${CMAKE_CURRENT_BINARY_DIR}/../plugins/sendnotifications/
${CMAKE_CURRENT_BINARY_DIR}/../smsapp/
)
set(kdeconnect_libraries
kdeconnectcore
kdeconnectversion
KF5::I18n
Qt5::DBus
Qt5::Network
Qt5::Test
${Qca_LIBRARY}
)
if(${KF5KIO_FOUND})
list(APPEND kdeconnect_libraries KF5::KIOWidgets)
endif()
set(kdeconnect_sms_libraries
kdeconnectsmshelper
Qt5::Test
)
ecm_add_test(pluginloadtest.cpp LINK_LIBRARIES ${kdeconnect_libraries})
ecm_add_test(sendfiletest.cpp LINK_LIBRARIES ${kdeconnect_libraries})
ecm_add_test(testsocketlinereader.cpp TEST_NAME testsocketlinereader LINK_LIBRARIES ${kdeconnect_libraries})