From e0b414448653e722f3e7255a9b8522be961ceb91 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Apr 2019 14:37:33 +0200 Subject: [PATCH] Force feature_summary to fail when a required package is not found Apparently calling set_package_properties with TYPE REQUIRED and then calling feature_summary with FATAL_ON_MISSING_REQUIRED_PACKAGES and PACKAGES_NOT_FOUND is not enough to make CMake fail when not finding a required package. You have to explicitly set REQUIRED_PACKAGES_NOT_FOUND to force feature_summary to fail when a package is not found. Do this, and also explicitly add the rest of the NOT FOUND cases, to get a slightly clearer overview what kind of packages were not found. Task-number: QTBUG-74133 Change-Id: Id21af13dafafe0a458cff479e8abbc6aa7e6a3f7 Reviewed-by: Tobias Hunger --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1eab8afcca..b43a662285 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,4 +53,9 @@ endif() include(QtPostProcess) ## Print a feature summary: -feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) +feature_summary(WHAT PACKAGES_FOUND + REQUIRED_PACKAGES_NOT_FOUND + RECOMMENDED_PACKAGES_NOT_FOUND + OPTIONAL_PACKAGES_NOT_FOUND + RUNTIME_PACKAGES_NOT_FOUND + FATAL_ON_MISSING_REQUIRED_PACKAGES)