From 085bd4a2cf8ae87109f31b0c1605bf05fa343858 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 48510b325..b7b748a41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,14 +32,38 @@ ecm_setup_version(1.0.80 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.7)