From a6db224fcb98d90309aea2795ad444e4c16231f0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 8 Aug 2019 13:32:20 +0200 Subject: [PATCH] [fsresizer] [partition] Gracefully fail on missing dependencies - If KPMcore is found -- it requires some other KDE Frameworks but at least in pre-4.0 versions doesn't check very well for them -- then missing its dependencies is no cause for CMake failure. Instead, log it nicely and suppress the module. --- src/modules/fsresizer/CMakeLists.txt | 14 +++++++++----- src/modules/partition/CMakeLists.txt | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/modules/fsresizer/CMakeLists.txt b/src/modules/fsresizer/CMakeLists.txt index ba9c81f4c..3d82489b7 100644 --- a/src/modules/fsresizer/CMakeLists.txt +++ b/src/modules/fsresizer/CMakeLists.txt @@ -1,11 +1,11 @@ find_package( KPMcore 3.3 ) +find_package( KF5Config CONFIG ) +find_package( KF5I18n CONFIG ) +find_package( KF5WidgetsAddons CONFIG ) set( _partition_defs "" ) -if ( KPMcore_FOUND ) - find_package( Qt5 REQUIRED DBus ) # Needed for KPMCore - find_package( KF5 REQUIRED I18n WidgetsAddons ) # Needed for KPMCore - +if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND ) include_directories( ${KPMCORE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/modules/partition ) if ( KPMcore_VERSION VERSION_GREATER "3.3.0") @@ -48,5 +48,9 @@ if ( KPMcore_FOUND ) target_compile_definitions( fsresizertest PRIVATE ${_partition_defs} ) endif() else() - calamares_skip_module( "fsresizer (missing suitable KPMcore)" ) + if ( NOT KPMcore_FOUND ) + calamares_skip_module( "fsresizer (missing suitable KPMcore)" ) + else() + calamares_skip_module( "fsresizer (missing dependencies for KPMcore)" ) + endif() endif() diff --git a/src/modules/partition/CMakeLists.txt b/src/modules/partition/CMakeLists.txt index df1588cb2..f9c32b39e 100644 --- a/src/modules/partition/CMakeLists.txt +++ b/src/modules/partition/CMakeLists.txt @@ -22,11 +22,11 @@ set_package_properties( KPMcore PROPERTIES PURPOSE "For partitioning module" ) +find_package( KF5Config CONFIG ) +find_package( KF5I18n CONFIG ) +find_package( KF5WidgetsAddons CONFIG ) -if ( KPMcore_FOUND ) - find_package( Qt5 REQUIRED DBus ) - find_package( KF5 REQUIRED Config CoreAddons I18n WidgetsAddons ) - +if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND ) if ( KPMcore_VERSION VERSION_GREATER "3.3.0") list( APPEND _partition_defs WITH_KPMCORE331API) # kpmcore > 3.3.0 with deprecations endif() @@ -106,5 +106,9 @@ if ( KPMcore_FOUND ) SHARED_LIB ) else() - calamares_skip_module( "partition (missing suitable KPMcore)" ) + if ( NOT KPMcore_FOUND ) + calamares_skip_module( "partition (missing suitable KPMcore)" ) + else() + calamares_skip_module( "partition (missing dependencies for KPMcore)" ) + endif() endif()