diff options
author | Brad King <brad.king@kitware.com> | 2017-01-30 13:43:23 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-01-30 13:43:23 (GMT) |
commit | 8df12fc9d4b52cdd18d4fa9408325be7d0c28ed2 (patch) | |
tree | 8162de8c02229d0d5a2e7824fed6e67031d7af48 /Tests | |
parent | 5c6c766da1b30f2d886ba369a4c407e575ee1ccf (diff) | |
parent | 560574b0c03f2cd8f34cf4a90f6f41648b08a1e9 (diff) | |
download | CMake-8df12fc9d4b52cdd18d4fa9408325be7d0c28ed2.zip CMake-8df12fc9d4b52cdd18d4fa9408325be7d0c28ed2.tar.gz CMake-8df12fc9d4b52cdd18d4fa9408325be7d0c28ed2.tar.bz2 |
Merge topic 'FeatureSummary_enhancement'
560574b0 FeatureSummary: Update release notes
3cfde818 FeatureSummary: Refactor to use global properties for package types
f0165eb6 FeatureSummary: Allow lists of dependencies in ADD_FEATURE_INFO
9da7bf08 FeatureSummary: Add QUIET_ON_EMPTY option to feature_summary
4cf4aceb FeatureSummary: Add unit tests
614a97a5 FeatureSummary: Do not force OPTIONAL type in SET_PACKAGE_PROPERTIES
65a0bfd8 FeatureSummary: Add deprecation warnings to deprecated commands
4da3cae9 FeatureSummary: Clean printed output
Diffstat (limited to 'Tests')
42 files changed, 518 insertions, 8 deletions
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-stderr.txt new file mode 100644 index 0000000..58f6125 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + Bad package property type OPTIONAL used in global property + FeatureSummary_DEFAULT_PKG_TYPE. Valid types are TYPE1, TYPE2 and TYPE3. + Either update FeatureSummary_DEFAULT_PKG_TYPE or add OPTIONAL to the + FeatureSummary_PKG_TYPES global property. +Call Stack \(most recent call first\): + .*/Modules/FeatureSummary\.cmake:[0-9]+. \(_FS_GET_FEATURE_SUMMARY\) + FeatureSummaryCustomBadDefault.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault.cmake new file mode 100644 index 0000000..7e2fd55 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault.cmake @@ -0,0 +1,8 @@ +include(FeatureSummary) +set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo) + +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stderr.txt new file mode 100644 index 0000000..e37b9f5 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + feature_summary\(\) Error: REQUIRED package\(s\) are missing, aborting CMake + run. +Call Stack \(most recent call first\): + FeatureSummaryCustomRequired.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stdout.txt new file mode 100644 index 0000000..ecca71f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stdout.txt @@ -0,0 +1,17 @@ +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have not been found: + + \* Bar + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have not been found: + + \* Bar + +-- Configuring incomplete, errors occurred! diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired.cmake new file mode 100644 index 0000000..11cf04c --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired.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 TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_DEFAULT_PKG_TYPE TYPE2) + +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) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stderr.txt new file mode 100644 index 0000000..c9d8b4b --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + feature_summary\(\) Error: REQUIRED package\(s\) are missing, aborting CMake + run. +Call Stack \(most recent call first\): + FeatureSummaryCustomRequiredListA.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stdout.txt new file mode 100644 index 0000000..b12d53a --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stdout.txt @@ -0,0 +1,17 @@ +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE1 packages have not been found: + + \* Bar + +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have not been found: + + \* Bar + +-- Configuring incomplete, errors occurred! diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA.cmake new file mode 100644 index 0000000..53111be --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA.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 TYPE2) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) + +set_package_properties(Bar PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stderr.txt new file mode 100644 index 0000000..8ef7a8d --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + feature_summary\(\) Error: REQUIRED package\(s\) are missing, aborting CMake + run. +Call Stack \(most recent call first\): + FeatureSummaryCustomRequiredListB.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stdout.txt new file mode 100644 index 0000000..5f07173 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stdout.txt @@ -0,0 +1,17 @@ +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE1 packages have not been found: + + \* Bar + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have not been found: + + \* Bar + +-- Configuring incomplete, errors occurred! diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake new file mode 100644 index 0000000..526b979 --- /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) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes-stdout.txt new file mode 100644 index 0000000..a7f973b --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes-stdout.txt @@ -0,0 +1,29 @@ +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE1 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes.cmake new file mode 100644 index 0000000..34b0c1f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes.cmake @@ -0,0 +1,36 @@ +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 TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_DEFAULT_PKG_TYPE TYPE2) + +find_package(Foo) + +# Type not set => TYPE2 +feature_summary(WHAT ALL) + +# TYPE1 > not set => TYPE1 +set_package_properties(Foo PROPERTIES TYPE TYPE1) +feature_summary(WHAT ALL) + +# TYPE2 > TYPE1 => TYPE2 +set_package_properties(Foo PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL) + +# TYPE1 < TYPE2 => TYPE2 +set_package_properties(Foo PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL) + +# TYPE3 > TYPE2 => TYPE3 +set_package_properties(Foo PROPERTIES TYPE TYPE3) +feature_summary(WHAT ALL) + +# TYPE2 < TYPE3 => TYPE3 +set_package_properties(Foo PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL) + +# TYPE1 < TYPE3 => TYPE3 +set_package_properties(Foo PROPERTIES TYPE TYPE1) +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-stderr.txt new file mode 100644 index 0000000..214d74a --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + feature_summary\(\) Error: REQUIRED package\(s\) are missing, aborting CMake + run. +Call Stack \(most recent call first\): + FeatureSummaryFatalOnMissingRequiredPackages.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-stdout.txt new file mode 100644 index 0000000..6bd6427 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages-stdout.txt @@ -0,0 +1,17 @@ +-- The following REQUIRED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have not been found: + + \* Bar + +-- The following REQUIRED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following REQUIRED packages have not been found: + + \* Bar + +-- Configuring incomplete, errors occurred! diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages.cmake new file mode 100644 index 0000000..9563186 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryFatalOnMissingRequiredPackages.cmake @@ -0,0 +1,12 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo) +find_package(Bar) + +set_package_properties(Foo PROPERTIES TYPE REQUIRED) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) + +set_package_properties(Bar PROPERTIES TYPE REQUIRED) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryIncludeQuietPackages-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryIncludeQuietPackages-stdout.txt new file mode 100644 index 0000000..58599e0 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryIncludeQuietPackages-stdout.txt @@ -0,0 +1,14 @@ +-- The following OPTIONAL packages have not been found: + + \* Baz + +-- The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have not been found: + + \* Bar + \* Baz + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryIncludeQuietPackages.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryIncludeQuietPackages.cmake new file mode 100644 index 0000000..5cdb443 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryIncludeQuietPackages.cmake @@ -0,0 +1,11 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo QUIET) +find_package(Bar QUIET) +find_package(Baz) + +feature_summary(WHAT ALL) + +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryMultipleDepends-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryMultipleDepends-stdout.txt new file mode 100644 index 0000000..d5875e0 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryMultipleDepends-stdout.txt @@ -0,0 +1,10 @@ +-- The following features have been enabled: + + \* Bar, Bar\. + \* Baz, Baz\. + \* Goo, Goo\. + +-- The following features have been disabled: + + \* Foo, Foo\. + \* Fez, Fez\. diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryMultipleDepends.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryMultipleDepends.cmake new file mode 100644 index 0000000..f355ae7 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryMultipleDepends.cmake @@ -0,0 +1,12 @@ +include(FeatureSummary) + +set(WITH_FOO 1) +set(WITH_BAR 0) + +add_feature_info(Foo "WITH_FOO;WITH_BAR" "Foo.") +add_feature_info(Bar "WITH_FOO;NOT WITH_BAR" "Bar.") +add_feature_info(Baz "WITH_FOO AND NOT WITH_BAR" "Baz.") +add_feature_info(Goo "WITH_FOO OR WITH_BAR" "Goo.") +add_feature_info(Fez "NOT WITH_FOO OR WITH_BAR" "Fez.") + +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryPurpose-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryPurpose-stdout.txt new file mode 100644 index 0000000..78e4fe1 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryPurpose-stdout.txt @@ -0,0 +1,16 @@ +The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + Because everyone needs some Foo. + +-- The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + Because everyone needs some Foo. + Because Foo is better than Bar. + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryPurpose.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryPurpose.cmake new file mode 100644 index 0000000..64735b6 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryPurpose.cmake @@ -0,0 +1,16 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo) + +# Purpose not set +feature_summary(WHAT ALL) + +# Purpose set once +set_package_properties(Foo PROPERTIES PURPOSE "Because everyone needs some Foo.") +feature_summary(WHAT ALL) + +# Purpose set twice +set_package_properties(Foo PROPERTIES PURPOSE "Because Foo is better than Bar.") +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryQuietOnEmpty-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryQuietOnEmpty-stdout.txt new file mode 100644 index 0000000..65e97e0 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryQuietOnEmpty-stdout.txt @@ -0,0 +1,5 @@ +-- Enabled features: + \* Foo, Foo\. + \* Bar, Bar\. + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryQuietOnEmpty.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryQuietOnEmpty.cmake new file mode 100644 index 0000000..8d1d007 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryQuietOnEmpty.cmake @@ -0,0 +1,14 @@ +include(FeatureSummary) + +set(WITH_FOO 1) +set(WITH_BAR 1) + +add_feature_info(Foo WITH_FOO "Foo.") +add_feature_info(Bar WITH_BAR "Bar.") + +feature_summary(WHAT ENABLED_FEATURES + DESCRIPTION "Enabled features:" + QUIET_ON_EMPTY) +feature_summary(WHAT DISABLED_FEATURES + DESCRIPTION "Disabled features:" + QUIET_ON_EMPTY) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryTypes-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryTypes-stdout.txt new file mode 100644 index 0000000..79bb1e3 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryTypes-stdout.txt @@ -0,0 +1,45 @@ +-- The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following RUNTIME packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following RECOMMENDED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following RECOMMENDED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following RECOMMENDED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following REQUIRED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following REQUIRED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following REQUIRED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following REQUIRED packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryTypes.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryTypes.cmake new file mode 100644 index 0000000..09d1e7a --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryTypes.cmake @@ -0,0 +1,48 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo) + +# Type not set => OPTIONAL +feature_summary(WHAT ALL) + +# RUNTIME > not set => RUNTIME +set_package_properties(Foo PROPERTIES TYPE RUNTIME) +feature_summary(WHAT ALL) + +# OPTIONAL > RUNTIME => OPTIONAL +set_package_properties(Foo PROPERTIES TYPE OPTIONAL) +feature_summary(WHAT ALL) + +# RUNTIME < OPTIONAL => OPTIONAL +set_package_properties(Foo PROPERTIES TYPE OPTIONAL) +feature_summary(WHAT ALL) + +# RECOMMENDED > OPTIONAL => RECOMMENDED +set_package_properties(Foo PROPERTIES TYPE RECOMMENDED) +feature_summary(WHAT ALL) + +# OPTIONAL < RECOMMENDED => RECOMMENDED +set_package_properties(Foo PROPERTIES TYPE OPTIONAL) +feature_summary(WHAT ALL) + +# RUNTIME < RECOMMENDED => RECOMMENDED +set_package_properties(Foo PROPERTIES TYPE RUNTIME) +feature_summary(WHAT ALL) + +# REQUIRED > RECOMMENDED => REQUIRED +set_package_properties(Foo PROPERTIES TYPE REQUIRED) +feature_summary(WHAT ALL) + +# RECOMMENDED < REQUIRED => REQUIRED +set_package_properties(Foo PROPERTIES TYPE RECOMMENDED) +feature_summary(WHAT ALL) + +# OPTIONAL < REQUIRED => REQUIRED +set_package_properties(Foo PROPERTIES TYPE OPTIONAL) +feature_summary(WHAT ALL) + +# RUNTIME < REQUIRED => REQUIRED +set_package_properties(Foo PROPERTIES TYPE RUNTIME) +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryURLDescription-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryURLDescription-stdout.txt new file mode 100644 index 0000000..6a55bdf --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryURLDescription-stdout.txt @@ -0,0 +1,32 @@ +-- The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have not been found: + + \* Bar + \* Baz + +-- The following OPTIONAL packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following OPTIONAL packages have not been found: + + \* Bar, <https://bar.net/> + \* Baz, A Baz package + +-- Warning: Property DESCRIPTION for package Foo already set to "The Foo package", overriding it with "A Foo package" +-- Warning: Property URL already set to "https://foo.example/", overriding it with "https://foo.net/" +-- Warning: Property URL already set to "https://bar.net/", overriding it with "https://bar.example/" +-- Warning: Property DESCRIPTION for package Baz already set to "A Baz package", overriding it with "The Baz package" +-- The following OPTIONAL packages have been found: + + \* Foo, A Foo package, <https://foo.net/> + +-- The following OPTIONAL packages have not been found: + + \* Bar, The Bar package, <https://bar.example/> + \* Baz, The Baz package, <https://baz.example/> + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryURLDescription.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryURLDescription.cmake new file mode 100644 index 0000000..77fcf28 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryURLDescription.cmake @@ -0,0 +1,28 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo) # URL and DESCRIPTION are set in the FindFoo.cmake file +find_package(Bar) # URL and DESCRIPTION are not set +find_package(Baz) # URL and DESCRIPTION are not set + +feature_summary(WHAT ALL) + +set_package_properties(Bar PROPERTIES URL "https://bar.net/") # URL and no DESCRIPTION +set_package_properties(Baz PROPERTIES DESCRIPTION "A Baz package") # DESCRIPTION and no URL +feature_summary(WHAT ALL) + +# Overwrite with the same value (no warning) +set_package_properties(Foo PROPERTIES URL "https://foo.example/" + DESCRIPTION "The Foo package") +set_package_properties(Bar PROPERTIES URL "https://bar.net/") +set_package_properties(Baz PROPERTIES DESCRIPTION "A Baz package") + +# Overwrite with different values (warnings) +set_package_properties(Foo PROPERTIES URL "https://foo.net/" + DESCRIPTION "A Foo package") # Overwrite URL and DESCRIPTION +set_package_properties(Bar PROPERTIES URL "https://bar.example/" + DESCRIPTION "The Bar package") # Overwrite URL and add DESCRIPTION +set_package_properties(Baz PROPERTIES URL "https://baz.example/" + DESCRIPTION "The Baz package") # Overwrite URL and add DESCRIPTION +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt index 9a3f023..f0631ae 100644 --- a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt @@ -1,7 +1,7 @@ -- The following features have been enabled: - \* Foo , Foo\. + \* Foo, Foo\. -- The following features have been disabled: - \* Bar , Bar\. + \* Bar, Bar\. diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt index 4d8f25f..f121417 100644 --- a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt @@ -1,7 +1,7 @@ -- The following features have been disabled: - \* Bar , Bar\. + \* Bar, Bar\. -- The following features have been enabled: - \* Foo , Foo\. + \* Foo, Foo\. diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce-stdout.txt index 39be105..8b4cd43 100644 --- a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce-stdout.txt +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce-stdout.txt @@ -1,4 +1,4 @@ --( ) - \* Foo , Foo decscription\. + \* Foo, Foo description\. + -- diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce.cmake index 545fb92..eaea40e 100644 --- a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce.cmake +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce.cmake @@ -2,7 +2,7 @@ include(FeatureSummary) set(WITH_FOO 1) -add_feature_info(Foo WITH_FOO "Foo decscription.") -add_feature_info(Foo WITH_FOO "Foo decscription.") +add_feature_info(Foo WITH_FOO "Foo description.") +add_feature_info(Foo WITH_FOO "Foo description.") feature_summary(WHAT ENABLED_FEATURES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt index 240632d..7485df9 100644 --- a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt @@ -1 +1 @@ - \* Foo , Foo\. + \* Foo, Foo\. diff --git a/Tests/RunCMake/FeatureSummary/FindBar.cmake b/Tests/RunCMake/FeatureSummary/FindBar.cmake new file mode 100644 index 0000000..45f4d54 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FindBar.cmake @@ -0,0 +1,2 @@ +include(FeatureSummary) +set(Bar_FOUND 0) diff --git a/Tests/RunCMake/FeatureSummary/FindBaz.cmake b/Tests/RunCMake/FeatureSummary/FindBaz.cmake new file mode 100644 index 0000000..73aafcd --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FindBaz.cmake @@ -0,0 +1,2 @@ +include(FeatureSummary) +set(Baz_FOUND 0) diff --git a/Tests/RunCMake/FeatureSummary/FindFoo.cmake b/Tests/RunCMake/FeatureSummary/FindFoo.cmake new file mode 100644 index 0000000..baec987 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FindFoo.cmake @@ -0,0 +1,4 @@ +include(FeatureSummary) +set_package_properties(Foo PROPERTIES URL "https://foo.example/" + DESCRIPTION "The Foo package") +set(Foo_FOUND 1) diff --git a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake index 6a5fc28..9caee4c 100644 --- a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake +++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake @@ -7,3 +7,15 @@ run_cmake(FeatureSummaryWhatList) run_cmake(FeatureSummaryWhatListUnknown) run_cmake(FeatureSummaryWhatListAll) run_cmake(FeatureSummaryWhatOnce) +run_cmake(FeatureSummaryPurpose) +run_cmake(FeatureSummaryURLDescription) +run_cmake(FeatureSummaryTypes) +run_cmake(FeatureSummaryFatalOnMissingRequiredPackages) +run_cmake(FeatureSummaryIncludeQuietPackages) +run_cmake(FeatureSummaryQuietOnEmpty) +run_cmake(FeatureSummaryMultipleDepends) +run_cmake(FeatureSummaryCustomTypes) +run_cmake(FeatureSummaryCustomBadDefault) +run_cmake(FeatureSummaryCustomRequired) +run_cmake(FeatureSummaryCustomRequiredListA) +run_cmake(FeatureSummaryCustomRequiredListB) |