From 759244b5d2a30c7d791b2d17437c731c81d2a1a3 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 7 Dec 2020 13:53:40 +0100 Subject: [PATCH] CMake: systematically use the feature-summary There's not much point in having a feature summary that will trip over just-a-few of the required packages, while also using REQUIRED in find_package() calls -- then you have to re-run CMake for all the REQUIRED ones you're missing, and then one more time for the packages that are required in the feature summary. Use the feature summary (e.g. TYPE REQUIRED) consistently. Then you can run CMake once and learn about all the missing dependencies in one go. --- CMakeLists.txt | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22f247cac..cc55802a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,14 +30,38 @@ ecm_setup_version(1.0.0 VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h ) -find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Core Quick Gui QuickControls2 Multimedia Svg) -find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 I18n Notifications Config CoreAddons) +find_package(Qt5 ${QT_MIN_VERSION} NO_MODULE COMPONENTS Widgets Core Quick Gui QuickControls2 Multimedia Svg) +set_package_properties(Qt5 PROPERTIES + TYPE REQUIRED + PURPOSE "Basic application components" +) +find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS Kirigami2 I18n Notifications Config CoreAddons) +set_package_properties(KF5 PROPERTIES + TYPE REQUIRED + PURPOSE "Basic application components" +) +set_package_properties(KF5Kirigami2 PROPERTIES + TYPE REQUIRED + PURPOSE "Kirigami application UI framework" +) if(ANDROID) - find_package(OpenSSL REQUIRED) + find_package(OpenSSL) + set_package_properties(OpenSSL PROPERTIES + TYPE REQUIRED + PURPOSE "Encrypted communications" + ) else() - find_package(Qt5Keychain REQUIRED) - find_package(KF5DBusAddons ${KF5_MIN_VERSION} REQUIRED) + find_package(Qt5Keychain) + set_package_properties(Qt5Keychain PROPERTIES + TYPE REQUIRED + PURPOSE "Secure storage of account secrets" + ) + find_package(KF5DBusAddons ${KF5_MIN_VERSION}) + set_package_properties(KF5DBusAddons PROPERTIES + TYPE REQUIRED + PURPOSE "DBus convenience functions" + ) endif() find_package(Quotient 0.6)