summaryrefslogtreecommitdiffstats
path: root/Modules/FeatureSummary.cmake
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <ddomenichelli@drdanz.it>2017-01-20 18:02:29 (GMT)
committerDaniele E. Domenichelli <ddomenichelli@drdanz.it>2017-01-26 09:52:37 (GMT)
commitf0165eb624403c26989d1039c076d61536cc3074 (patch)
tree3feb32dd02df6eb383589bffa29674a4ba053c38 /Modules/FeatureSummary.cmake
parent9da7bf082513952c47ffb738b722df49a2fd7152 (diff)
downloadCMake-f0165eb624403c26989d1039c076d61536cc3074.zip
CMake-f0165eb624403c26989d1039c076d61536cc3074.tar.gz
CMake-f0165eb624403c26989d1039c076d61536cc3074.tar.bz2
FeatureSummary: Allow lists of dependencies in ADD_FEATURE_INFO
Diffstat (limited to 'Modules/FeatureSummary.cmake')
-rw-r--r--Modules/FeatureSummary.cmake14
1 files changed, 12 insertions, 2 deletions
diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake
index dce0330..490c956 100644
--- a/Modules/FeatureSummary.cmake
+++ b/Modules/FeatureSummary.cmake
@@ -477,7 +477,8 @@ endfunction()
add_feature_info(<name> <enabled> <description>)
Use this macro to add information about a feature with the given ``<name>``.
- ``<enabled>`` contains whether this feature is enabled or not.
+ ``<enabled>`` contains whether this feature is enabled or not. It can be a
+ variable or a list of conditions.
``<description>`` is a text describing the feature. The information can
be displayed using ``feature_summary()`` for ``ENABLED_FEATURES`` and
``DISABLED_FEATURES`` respectively.
@@ -489,7 +490,16 @@ endfunction()
option(WITH_FOO "Help for foo" ON)
add_feature_info(Foo WITH_FOO "The Foo feature provides very cool stuff.")
#]=======================================================================]
-function(ADD_FEATURE_INFO _name _enabled _desc)
+function(ADD_FEATURE_INFO _name _depends _desc)
+ set(_enabled 1)
+ foreach(_d ${_depends})
+ string(REGEX REPLACE " +" ";" _d "${_d}")
+ if(${_d})
+ else()
+ set(_enabled 0)
+ break()
+ endif()
+ endforeach()
if (${_enabled})
set_property(GLOBAL APPEND PROPERTY ENABLED_FEATURES "${_name}")
else ()