From a01262a535f34a328f85c590fce7eb329b12702e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 30 Apr 2019 13:38:46 +0200 Subject: [PATCH] CMake: massage dependency-finding - If KPMCore is not found, don't require the KF5 components that it would depend on. - If ECM is found, use KDEInstallDirs always, not just when the partitioning module is used. --- CMakeLists.txt | 1 + src/modules/fsresizer/CMakeLists.txt | 5 +++-- src/modules/partition/CMakeLists.txt | 8 +++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac4f7d811..8fe0c0522 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,6 +269,7 @@ if( ECM_FOUND ) find_package( Qt5 COMPONENTS Test REQUIRED ) include( ECMAddTests ) endif() + include(KDEInstallDirs) endif() find_package( KF5 COMPONENTS CoreAddons Crash ) diff --git a/src/modules/fsresizer/CMakeLists.txt b/src/modules/fsresizer/CMakeLists.txt index 36c8c764c..9c1da386b 100644 --- a/src/modules/fsresizer/CMakeLists.txt +++ b/src/modules/fsresizer/CMakeLists.txt @@ -1,10 +1,11 @@ find_package( KPMcore 3.3 ) -find_package( Qt5 REQUIRED DBus ) # Needed for KPMCore -find_package( KF5 REQUIRED I18n WidgetsAddons ) # Needed for KPMCore set( _partition_defs "" ) if ( KPMcore_FOUND ) + find_package( Qt5 REQUIRED DBus ) # Needed for KPMCore + find_package( KF5 REQUIRED I18n WidgetsAddons ) # Needed for KPMCore + include_directories( ${KPMCORE_INCLUDE_DIR} ) include_directories( ${PROJECT_BINARY_DIR}/src/libcalamares ) diff --git a/src/modules/partition/CMakeLists.txt b/src/modules/partition/CMakeLists.txt index 9bcace064..61953c249 100644 --- a/src/modules/partition/CMakeLists.txt +++ b/src/modules/partition/CMakeLists.txt @@ -15,11 +15,6 @@ endif() find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) -include(KDEInstallDirs) -include(GenerateExportHeader) -find_package( Qt5 REQUIRED DBus ) -find_package( KF5 REQUIRED Config CoreAddons I18n WidgetsAddons ) - find_package( KPMcore 3.3 ) set_package_properties( KPMcore PROPERTIES @@ -27,6 +22,9 @@ set_package_properties( ) if ( KPMcore_FOUND ) + find_package( Qt5 REQUIRED DBus ) + find_package( KF5 REQUIRED Config CoreAddons I18n WidgetsAddons ) + if ( KPMcore_VERSION VERSION_GREATER "3.3.0") list( APPEND _partition_defs WITH_KPMCORE331API) # kpmcore > 3.3.0 with deprecations endif()