[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.
This commit is contained in:
Adriaan de Groot 2019-04-12 11:18:29 +02:00
parent 9917bc27fc
commit 9159761171
2 changed files with 7 additions and 4 deletions

View File

@ -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
)

View File

@ -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} )