diff --git a/CMakeLists.txt b/CMakeLists.txt index c87920d84..82821070d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.0) + project(kdeconnect) set(KDECONNECT_VERSION_MAJOR 1) @@ -5,15 +7,16 @@ set(KDECONNECT_VERSION_MINOR 2) set(KDECONNECT_VERSION_PATCH 1) set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}") -cmake_minimum_required(VERSION 2.8.12) +set(QT_MIN_VERSION "5.7.0") +set(KF5_MIN_VERSION "5.42.0") -find_package(ECM 0.0.9 REQUIRED NO_MODULE) +find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake) -find_package(Qt5 5.2 REQUIRED COMPONENTS Quick) +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Quick) -find_package(KF5 5.42.0 REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons) -find_package(KF5DocTools) +find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils) +find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS DocTools) find_package(Qca-qt5 2.1.0 REQUIRED) include_directories(${CMAKE_SOURCE_DIR}) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index be99034b9..5b52157cf 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(KF5 COMPONENTS Declarative) +find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Declarative) qt5_add_resources(kcapp_SRCS resources.qrc) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 0b4d213ab..31138b4b0 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -11,12 +11,10 @@ add_subdirectory(backends/loopback) option(BLUETOOTH_ENABLED "Bluetooth support for kdeconnect" OFF) if(BLUETOOTH_ENABLED) - find_package(Qt5 REQUIRED COMPONENTS Bluetooth) + find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Bluetooth) add_subdirectory(backends/bluetooth) endif() -find_package(KF5Notifications 5.9 REQUIRED) - set(kdeconnectcore_SRCS ${backends_kdeconnect_SRCS} diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 649fe4a4d..5ef993825 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -1,7 +1,5 @@ project(kdeconnectd) -find_package(KF5 REQUIRED COMPONENTS Notifications KIO) - add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kded") add_executable(kdeconnectd kdeconnectd.cpp) diff --git a/fileitemactionplugin/CMakeLists.txt b/fileitemactionplugin/CMakeLists.txt index a5fafd52a..d4af2952c 100644 --- a/fileitemactionplugin/CMakeLists.txt +++ b/fileitemactionplugin/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS KIO) - add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-fileitemaction") include_directories(${CMAKE_SOURCE_DIR}) diff --git a/indicator/CMakeLists.txt b/indicator/CMakeLists.txt index a78145b9c..ae1a4d348 100644 --- a/indicator/CMakeLists.txt +++ b/indicator/CMakeLists.txt @@ -1,6 +1,3 @@ -find_package(KF5Notifications REQUIRED) -find_package(KF5KCMUtils REQUIRED) - set(indicator_SRCS main.cpp deviceindicator.cpp diff --git a/kcm/CMakeLists.txt b/kcm/CMakeLists.txt index 20c3510ab..cc9c1ae4b 100644 --- a/kcm/CMakeLists.txt +++ b/kcm/CMakeLists.txt @@ -1,7 +1,5 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kcm") -find_package(KF5KCMUtils 5.9 REQUIRED) - include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} diff --git a/kcmplugin/CMakeLists.txt b/kcmplugin/CMakeLists.txt index 324f16b3c..d01b902a6 100644 --- a/kcmplugin/CMakeLists.txt +++ b/kcmplugin/CMakeLists.txt @@ -2,8 +2,6 @@ project(kdeconnectpluginkcm) add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-core\") -find_package(KF5 REQUIRED COMPONENTS KCMUtils) - add_library(kdeconnectpluginkcm kdeconnectpluginkcm.cpp) target_link_libraries(kdeconnectpluginkcm PUBLIC diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt index d3eaf68c5..fc81f4a20 100644 --- a/kio/CMakeLists.txt +++ b/kio/CMakeLists.txt @@ -1,6 +1,5 @@ include_directories(${CMAKE_SOURCE_DIR}) add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kio") -find_package(KF5 REQUIRED COMPONENTS KIO) set(kio_kdeconnect_PART_SRCS kiokdeconnect.cpp diff --git a/plugins/battery/CMakeLists.txt b/plugins/battery/CMakeLists.txt index a312ea66d..26f6f0763 100644 --- a/plugins/battery/CMakeLists.txt +++ b/plugins/battery/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS Notifications) - set(kdeconnect_battery_SRCS batteryplugin.cpp batterydbusinterface.cpp diff --git a/plugins/mousepad/CMakeLists.txt b/plugins/mousepad/CMakeLists.txt index f76ce51d5..2b2124cc4 100644 --- a/plugins/mousepad/CMakeLists.txt +++ b/plugins/mousepad/CMakeLists.txt @@ -8,9 +8,9 @@ set_package_properties(LibFakeKey PROPERTIES DESCRIPTION "fake key events" if (LibFakeKey_FOUND) find_package(XTest REQUIRED) find_package(X11 REQUIRED) - find_package(Qt5X11Extras REQUIRED) + find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras) endif() -find_package(KF5Wayland 5.3.90) +find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Wayland) set(HAVE_X11 ${LibFakeKey_FOUND}) set(HAVE_WAYLAND ${KF5Wayland_FOUND}) diff --git a/plugins/notifications/CMakeLists.txt b/plugins/notifications/CMakeLists.txt index 86f962c54..74561b917 100644 --- a/plugins/notifications/CMakeLists.txt +++ b/plugins/notifications/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS Notifications KCMUtils I18n IconThemes Config) - set(kdeconnect_notifications_SRCS notification.cpp notificationsplugin.cpp @@ -16,5 +14,4 @@ target_link_libraries(kdeconnect_notifications Qt5::DBus KF5::Notifications KF5::I18n - KF5::IconThemes ) diff --git a/plugins/pausemusic/CMakeLists.txt b/plugins/pausemusic/CMakeLists.txt index d13aa3e50..e67ced7f3 100644 --- a/plugins/pausemusic/CMakeLists.txt +++ b/plugins/pausemusic/CMakeLists.txt @@ -1,4 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS KCMUtils) find_program(PACTL pactl) kdeconnect_add_plugin(kdeconnect_pausemusic JSON kdeconnect_pausemusic.json SOURCES pausemusicplugin.cpp) diff --git a/plugins/ping/CMakeLists.txt b/plugins/ping/CMakeLists.txt index c9438af5d..99f7c83ec 100644 --- a/plugins/ping/CMakeLists.txt +++ b/plugins/ping/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS Notifications) - set(kdeconnect_ping_SRCS pingplugin.cpp ) diff --git a/plugins/screensaver-inhibit/CMakeLists.txt b/plugins/screensaver-inhibit/CMakeLists.txt index 4ec929e70..344385def 100644 --- a/plugins/screensaver-inhibit/CMakeLists.txt +++ b/plugins/screensaver-inhibit/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS Notifications) - set(kdeconnect_screensaver_inhibit_SRCS screensaverinhibitplugin.cpp ) diff --git a/plugins/sendnotifications/CMakeLists.txt b/plugins/sendnotifications/CMakeLists.txt index f04d80934..a6d972d07 100644 --- a/plugins/sendnotifications/CMakeLists.txt +++ b/plugins/sendnotifications/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS Notifications KCMUtils I18n IconThemes) - set(kdeconnect_sendnotifications_SRCS sendnotificationsplugin.cpp notificationslistener.cpp diff --git a/plugins/sftp/CMakeLists.txt b/plugins/sftp/CMakeLists.txt index 746904867..d914db5ab 100644 --- a/plugins/sftp/CMakeLists.txt +++ b/plugins/sftp/CMakeLists.txt @@ -2,8 +2,6 @@ find_program(HAVE_FUSERMOUNT fusermount) configure_file(config-sftp.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-sftp.h ) -find_package(KF5 REQUIRED COMPONENTS Notifications KIO) - set(kdeconnect_sftp_SRCS mounter.cpp mountloop.cpp diff --git a/plugins/share/CMakeLists.txt b/plugins/share/CMakeLists.txt index f72ded465..794f22f4d 100644 --- a/plugins/share/CMakeLists.txt +++ b/plugins/share/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS Notifications KIO) - set(kdeconnect_share_SRCS shareplugin.cpp ) diff --git a/plugins/telephony/CMakeLists.txt b/plugins/telephony/CMakeLists.txt index f9d4614f9..933c4591e 100644 --- a/plugins/telephony/CMakeLists.txt +++ b/plugins/telephony/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(KF5 REQUIRED COMPONENTS Notifications) - include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../notifications/) # needed for the sendreplydialog diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a18fcc55f..c6be48d4d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,4 @@ -find_package(Qt5 REQUIRED COMPONENTS Test) -find_package(KF5 REQUIRED COMPONENTS KIO Notifications IconThemes) +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test) include_directories( ${KDEConnectCore_BINARY_DIR}