From e00ffbb4f6c023b46c8d597e526884fb2c2bde6d Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Fri, 21 Jul 2023 15:04:19 +0300 Subject: [PATCH] Use versionless cmake variable for KF requirements Also, adjust find_package calls that are hidden behind a feature flag --- CMakeLists.txt | 10 +++++----- core/CMakeLists.txt | 4 ++-- plugins/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50cd94858..5d0b79147 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,11 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE project(kdeconnect VERSION ${RELEASE_SERVICE_VERSION}) -set(KF5_MIN_VERSION "5.101.0") +set(KF_MIN_VERSION "5.101.0") set(QT_MIN_VERSION "5.15.2") set(QCA_MIN_VERSION "2.1.0") -find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) +find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) include(KDEInstallDirs) @@ -51,7 +51,7 @@ endif() ecm_set_disabled_deprecation_versions( QT ${QT_MIN_VERSION} - KF ${KF5_MIN_VERSION} + KF ${KF_MIN_VERSION} ) # Make the version header available by linking against kdeconnectversion @@ -107,7 +107,7 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Qu if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5") find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras) endif() -find_package(KF${QT_MAJOR_VERSION} ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS}) +find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS}) if (WIN32) get_filename_component(WINDOWS_KITS_DIR @@ -122,7 +122,7 @@ add_subdirectory(core) add_subdirectory(plugins) add_subdirectory(interfaces) -find_package(KF${QT_MAJOR_VERSION}QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED) +find_package(KF${QT_MAJOR_VERSION}QQC2DesktopStyle ${KF_MIN_VERSION} REQUIRED) set_package_properties(KF${QT_MAJOR_VERSION}QQC2DesktopStyle PROPERTIES TYPE RUNTIME) add_subdirectory(icons) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 364b26695..4c4f249fb 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -12,12 +12,12 @@ add_subdirectory(backends/loopback) option(MDNS_ENABLED "Use MDNS for device discovery (under development)" OFF) if (MDNS_ENABLED) - find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DNSSD) + find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS DNSSD) endif() option(BLUETOOTH_ENABLED "Bluetooth support for kdeconnect" OFF) if(BLUETOOTH_ENABLED) - find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Bluetooth) + find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Bluetooth) add_subdirectory(backends/bluetooth) endif() diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index a68b47e4d..3b162056e 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -38,7 +38,7 @@ add_subdirectory(screensaver-inhibit) add_subdirectory(virtualmonitor) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - find_package(KF${QT_MAJOR_VERSION}ModemManagerQt ${KF5_MIN_VERSION}) + find_package(KF${QT_MAJOR_VERSION}ModemManagerQt ${KF_MIN_VERSION}) if (TARGET KF${QT_MAJOR_VERSION}::ModemManagerQt) add_subdirectory(mmtelephony) endif()