FeatureSummary: Print each feature info only once

If a feature is added multiple times via ADD_FEATURE_INFO it should
appear only once in FEATURE_SUMMARY.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
This commit is contained in:
Gregor Jasny 2015-02-22 21:06:27 +01:00 committed by Brad King
parent cb16c7844d
commit 38ef2b7363
4 changed files with 16 additions and 0 deletions

View File

@ -379,6 +379,9 @@ function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
set(_currentFeatureText "") set(_currentFeatureText "")
get_property(_EnabledFeatures GLOBAL PROPERTY ${_property}) get_property(_EnabledFeatures GLOBAL PROPERTY ${_property})
if(_EnabledFeatures)
list(REMOVE_DUPLICATES _EnabledFeatures)
endif(_EnabledFeatures)
foreach(_currentFeature ${_EnabledFeatures}) foreach(_currentFeature ${_EnabledFeatures})

View File

@ -0,0 +1,4 @@
--( )
\* Foo , Foo decscription\.
+
--

View File

@ -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)

View File

@ -6,3 +6,4 @@ run_cmake(FeatureSummaryWhatSingleUnknown)
run_cmake(FeatureSummaryWhatList) run_cmake(FeatureSummaryWhatList)
run_cmake(FeatureSummaryWhatListUnknown) run_cmake(FeatureSummaryWhatListUnknown)
run_cmake(FeatureSummaryWhatListAll) run_cmake(FeatureSummaryWhatListAll)
run_cmake(FeatureSummaryWhatOnce)