diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,22 @@ +cmake_minimum_required(VERSION 3.0) + project(kdeconnect) set(KDECONNECT_VERSION_MAJOR 1) 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 --- 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 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -11,12 +11,10 @@ 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 --- 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 --- 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 --- 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 --- 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 --- a/kcmplugin/CMakeLists.txt +++ b/kcmplugin/CMakeLists.txt @@ -2,8 +2,6 @@ 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 --- 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 --- 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 --- a/plugins/mousepad/CMakeLists.txt +++ b/plugins/mousepad/CMakeLists.txt @@ -8,9 +8,9 @@ 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 --- 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 @@ Qt5::DBus KF5::Notifications KF5::I18n - KF5::IconThemes ) diff --git a/plugins/pausemusic/CMakeLists.txt b/plugins/pausemusic/CMakeLists.txt --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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}