summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <ddomenichelli@drdanz.it>2017-01-20 18:00:07 (GMT)
committerDaniele E. Domenichelli <ddomenichelli@drdanz.it>2017-01-26 09:52:35 (GMT)
commit9da7bf082513952c47ffb738b722df49a2fd7152 (patch)
tree72af8719308a97e736a8693ad65e17168d1e3c8f /Tests/RunCMake
parent4cf4acebe347bfd55e051354b9748a5b0c25b58a (diff)
downloadCMake-9da7bf082513952c47ffb738b722df49a2fd7152.zip
CMake-9da7bf082513952c47ffb738b722df49a2fd7152.tar.gz
CMake-9da7bf082513952c47ffb738b722df49a2fd7152.tar.bz2
FeatureSummary: Add QUIET_ON_EMPTY option to feature_summary
This option suppresses the output when the list of packages that belong to the selected category is empty.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryQuietOnEmpty-stdout.txt5
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryQuietOnEmpty.cmake14
-rw-r--r--Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake1
3 files changed, 20 insertions, 0 deletions
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/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
index 2edd8a5..585a6ee 100644
--- a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
@@ -12,3 +12,4 @@ run_cmake(FeatureSummaryURLDescription)
run_cmake(FeatureSummaryTypes)
run_cmake(FeatureSummaryFatalOnMissingRequiredPackages)
run_cmake(FeatureSummaryIncludeQuietPackages)
+run_cmake(FeatureSummaryQuietOnEmpty)