summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <ddomenichelli@drdanz.it>2017-01-25 09:34:45 +0100
committerDaniele E. Domenichelli <ddomenichelli@drdanz.it>2017-01-26 12:28:12 +0100
commit3cfde818354a8f8e26a9b0b6589f3cc38b50e48d (patch)
tree0ed96321ae86471390ee0a41d2cc416da3d92c0c /Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake
parentf0165eb624403c26989d1039c076d61536cc3074 (diff)
downloadcmake-3cfde818354a8f8e26a9b0b6589f3cc38b50e48d.tar.gz
FeatureSummary: Refactor to use global properties for package types
These new global properties were added: * FeatureSummary_PKG_TYPES: Package types accepted by FeatureSummary (default REQUIRED RECOMMENDED OPTIONAL RUNTIME). * FeatureSummary_REQUIRED_PKG_TYPES: Package types that will cause FeatureSummary to abort when called with FATAL_ON_MISSING_REQUIRED_PACKAGES and a package in these categories is missing (default REQUIRED). * FeatureSummary_DEFAULT_PKG_TYPE: Default package type assigned when not explicitly assigned by the user (default OPTIONAL). This allows to add and remove new package types that can be printed selectively using the "WHAT" argument.
Diffstat (limited to 'Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake')
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake
new file mode 100644
index 0000000000..526b979aaf
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake
@@ -0,0 +1,16 @@
+include(FeatureSummary)
+
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3)
+set_property(GLOBAL PROPERTY FeatureSummary_REQUIRED_PKG_TYPES TYPE2 TYPE3)
+set_property(GLOBAL PROPERTY FeatureSummary_DEFAULT_PKG_TYPE TYPE1)
+
+find_package(Foo)
+find_package(Bar)
+
+set_package_properties(Foo PROPERTIES TYPE TYPE3)
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
+
+set_package_properties(Bar PROPERTIES TYPE TYPE3)
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)