From 9159761171555715f54a8e01706d7595c9a92099 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 12 Apr 2019 11:18:29 +0200 Subject: [PATCH] [partition] [fsresizer] Fix KPMCore API detection - There will be a 3.3.1 which still has the "old" API, so look at 3.3.80 (pre-4.0) instead. Make the way compile flags are passed consistent. --- src/modules/fsresizer/CMakeLists.txt | 7 +++++-- src/modules/partition/CMakeLists.txt | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/fsresizer/CMakeLists.txt b/src/modules/fsresizer/CMakeLists.txt index 12349c835..4351dca51 100644 --- a/src/modules/fsresizer/CMakeLists.txt +++ b/src/modules/fsresizer/CMakeLists.txt @@ -2,12 +2,14 @@ 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 ) include_directories( ${KPMCORE_INCLUDE_DIR} ) include_directories( ${PROJECT_BINARY_DIR}/src/libcalamares ) - if ( KPMcore_VERSION VERSION_GREATER "3.3.0") - add_definitions(-DWITH_KPMCOREGT33) # kpmcore greater than 3.3 + if ( KPMcore_VERSION VERSION_GREATER "3.90") + list( APPEND _partition_defs WITH_KPMCORE4API) # kpmcore 4 with new API endif() # The PartitionIterator is a small class, and it's easiest -- but also a @@ -21,6 +23,7 @@ if ( KPMcore_FOUND ) LINK_PRIVATE_LIBRARIES kpmcore calamares + COMPILE_DEFINITIONS ${_partition_defs} SHARED_LIB ) diff --git a/src/modules/partition/CMakeLists.txt b/src/modules/partition/CMakeLists.txt index 56520845e..844c50ed4 100644 --- a/src/modules/partition/CMakeLists.txt +++ b/src/modules/partition/CMakeLists.txt @@ -27,8 +27,8 @@ set_package_properties( ) if ( KPMcore_FOUND ) - if ( KPMcore_VERSION VERSION_GREATER "3.3.0") - add_definitions(-DWITH_KPMCOREGT33) # kpmcore greater than 3.3 + if ( KPMcore_VERSION VERSION_GREATER "3.90") + list( APPEND _partition_defs WITH_KPMCORE4API) # kpmcore 4 with new API endif() include_directories( ${KPMCORE_INCLUDE_DIR} )