CMake: Handle KPMCore version better

- provide complete information for feature_summary
 - set the right API version when building libcalamares
 - report the beta version number when it's wrong
This commit is contained in:
Adriaan de Groot 2019-06-14 23:57:07 +02:00
parent f6373561d3
commit 8e4a2b3543
3 changed files with 14 additions and 5 deletions

View file

@ -103,6 +103,9 @@ endif()
find_package( KPMcore 3.3 )
set_package_properties(
KPMcore PROPERTIES
URL "https://invent.kde.org/kde/kpmcore"
DESCRIPTION "KDE Partitioning library"
TYPE RECOMMENDED
PURPOSE "For partitioning service"
)
@ -110,8 +113,10 @@ if ( KPMcore_FOUND )
find_package( Qt5 REQUIRED DBus ) # Needed for KPMCore
find_package( KF5 REQUIRED I18n WidgetsAddons ) # Needed for KPMCore
if( KPMcore_VERSION VERSION_GREATER "3.3.70" AND KPMcore_VERSION VERSION_LESS "4.0" )
message( FATAL_ERROR "KPMCore beta versions are not supported" )
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
add_definitions( -DWITH_KPMCORE4API ) # kpmcore 4 with new API
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} not supported" )
endif()
include_directories( ${KPMCORE_INCLUDE_DIR} )

View file

@ -1,4 +1,8 @@
find_package( KPMcore 3.3 )
set_package_properties(
KPMcore PROPERTIES
PURPOSE "For fsresizer module"
)
set( _partition_defs "" )
@ -11,7 +15,7 @@ if ( KPMcore_FOUND )
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
list( APPEND _partition_defs WITH_KPMCORE4API ) # kpmcore 4 with new API
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
message( FATAL_ERROR "KPMCore beta versions are not supported" )
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} are not supported" )
endif()
# The PartitionIterator is a small class, and it's easiest -- but also a

View file

@ -18,7 +18,7 @@ find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE)
find_package( KPMcore 3.3 )
set_package_properties(
KPMcore PROPERTIES
PURPOSE "For partitioning module"
PURPOSE "For partition module"
)
if ( KPMcore_FOUND )
@ -28,7 +28,7 @@ if ( KPMcore_FOUND )
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
list( APPEND _partition_defs WITH_KPMCORE4API ) # kpmcore 4 with new API
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
message( FATAL_ERROR "KPMCore beta versions are not supported" )
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} are not supported" )
endif()
include_directories( ${KPMCORE_INCLUDE_DIR} )