summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-24 14:12:43 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-02-24 14:12:43 (GMT)
commit13f9f848defa75f7d728050b4d99d44b194642b2 (patch)
tree88f5a7372c6eaf797a60188672599d04ad871e5b
parent3bda0717b31aa63e906cbc6129674a9e046f1066 (diff)
parent38ef2b7363533746cfc14dbc55d696de3cc75386 (diff)
downloadCMake-13f9f848defa75f7d728050b4d99d44b194642b2.zip
CMake-13f9f848defa75f7d728050b4d99d44b194642b2.tar.gz
CMake-13f9f848defa75f7d728050b4d99d44b194642b2.tar.bz2
Merge topic 'FeatureSummary-no-duplicates'
38ef2b73 FeatureSummary: Print each feature info only once
-rw-r--r--Modules/FeatureSummary.cmake3
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce-stdout.txt4
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce.cmake8
-rw-r--r--Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake1
4 files changed, 16 insertions, 0 deletions
diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake
index 3eea9db..ce5a4ed 100644
--- a/Modules/FeatureSummary.cmake
+++ b/Modules/FeatureSummary.cmake
@@ -379,6 +379,9 @@ function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
set(_currentFeatureText "")
get_property(_EnabledFeatures GLOBAL PROPERTY ${_property})
+ if(_EnabledFeatures)
+ list(REMOVE_DUPLICATES _EnabledFeatures)
+ endif(_EnabledFeatures)
foreach(_currentFeature ${_EnabledFeatures})
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce-stdout.txt
new file mode 100644
index 0000000..39be105
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce-stdout.txt
@@ -0,0 +1,4 @@
+--( )
+ \* Foo , Foo decscription\.
++
+--
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce.cmake
new file mode 100644
index 0000000..545fb92
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatOnce.cmake
@@ -0,0 +1,8 @@
+include(FeatureSummary)
+
+set(WITH_FOO 1)
+
+add_feature_info(Foo WITH_FOO "Foo decscription.")
+add_feature_info(Foo WITH_FOO "Foo decscription.")
+
+feature_summary(WHAT ENABLED_FEATURES)
diff --git a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
index 1417338..6a5fc28 100644
--- a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
@@ -6,3 +6,4 @@ run_cmake(FeatureSummaryWhatSingleUnknown)
run_cmake(FeatureSummaryWhatList)
run_cmake(FeatureSummaryWhatListUnknown)
run_cmake(FeatureSummaryWhatListAll)
+run_cmake(FeatureSummaryWhatOnce)