CMake: do REQUIRED searches at beginning, avoid toggle of KF5 status

This commit is contained in:
Adriaan de Groot 2023-09-09 11:59:02 +02:00
parent 0500eb54da
commit 0a0edfada0

View File

@ -348,36 +348,15 @@ if(ECM_FOUND)
include(KDEInstallDirs) include(KDEInstallDirs)
endif() endif()
find_package(${kfname} ${KF_VERSION} QUIET COMPONENTS CoreAddons) find_package(${kfname} ${KF_VERSION} QUIET REQUIRED COMPONENTS CoreAddons)
set_package_properties( # After this point, there should be no REQUIRED find_packages,
${kfname} # since we want tidy reporting of optional dependencies.
PROPERTIES
TYPE REQUIRED
DESCRIPTION "KDE Frameworks (CoreAddons)"
URL "https://api.kde.org/frameworks/kcoreaddons/"
PURPOSE "About Calamares"
)
feature_summary(
WHAT REQUIRED_PACKAGES_NOT_FOUND
FATAL_ON_MISSING_REQUIRED_PACKAGES
DESCRIPTION "The following REQUIRED packages were not found:"
QUIET_ON_EMPTY
)
# #
# OPTIONAL DEPENDENCIES # OPTIONAL DEPENDENCIES
# #
# First, set KF back to optional so that any missing components don't trip us up. # First, set KF back to optional so that any missing components don't trip us up.
find_package(${kfname} ${KF_VERSION} QUIET COMPONENTS CoreAddons Crash) find_package(${kfname} ${KF_VERSION} QUIET COMPONENTS CoreAddons Crash)
set_package_properties(
${kfname}
PROPERTIES
TYPE OPTIONAL
DESCRIPTION "KDE Frameworks"
URL "https://api.kde.org/frameworks/"
PURPOSE "KDE Integration"
)
if(NOT TARGET ${kfname}::Crash) if(NOT TARGET ${kfname}::Crash)
if(BUILD_CRASH_REPORTING) if(BUILD_CRASH_REPORTING)