1 # - Macros for generating a summary of enabled/disabled features
3 # PRINT_ENABLED_FEATURES()
4 # Print a summary of all enabled features. By default all successfull
5 # FIND_PACKAGE() calls will appear here, except the ones which used the QUIET keyword.
6 # Additional features can be added by appending an entry to the global ENABLED_FEATURES
7 # property. If SET_FEATURE_INFO() is used for that feature, the output will be much
10 # PRINT_DISABLED_FEATURES()
11 # Same as PRINT_ENABLED_FEATURES(), but for disabled features. It can be extended
12 # the same way by adding to the global property DISABLED_FEATURES.
14 # SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ] )
15 # Use this macro to set up information about the named feature, which will
16 # then be displayed by PRINT_ENABLED/DISABLED_FEATURES().
17 # Example: SET_FEATURE_INFO(LibXml2 "XML processing library." "http://xmlsoft.org/")
21 MACRO(SET_FEATURE_INFO _name _desc)
23 SET(_comment "${ARGV3}")
24 SET_PROPERTY(GLOBAL PROPERTY ${_name}_DESCRIPTION "${_desc}" )
26 SET_PROPERTY(GLOBAL PROPERTY ${_name}_URL "${_url}" )
27 ENDIF(_url MATCHES ".+")
28 IF(_comment MATCHES ".+")
29 SET_PROPERTY(GLOBAL PROPERTY ${_name}_COMMENT "${_comment}" )
30 ENDIF(_comment MATCHES ".+")
31 ENDMACRO(SET_FEATURE_INFO)
34 MACRO(_PRINT_FEATURES _property _text)
35 SET(_currentFeatureText "${_text}")
36 GET_PROPERTY(_EnabledFeatures GLOBAL PROPERTY ${_property})
37 FOREACH(_currentFeature ${_EnabledFeatures})
38 SET(_currentFeatureText "${_currentFeatureText}\n${_currentFeature}")
39 GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_DESCRIPTION)
41 SET(_currentFeatureText "${_currentFeatureText} , ${_info}")
43 GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_URL)
45 SET(_currentFeatureText "${_currentFeatureText} , <${_info}>")
47 GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_COMMENT)
49 SET(_currentFeatureText "${_currentFeatureText} , ${_info}")
51 ENDFOREACH(_currentFeature)
52 MESSAGE(STATUS "${_currentFeatureText}\n")
53 ENDMACRO(_PRINT_FEATURES)
56 MACRO(PRINT_ENABLED_FEATURES)
57 _PRINT_FEATURES( ENABLED_FEATURES "Enabled features:")
58 ENDMACRO(PRINT_ENABLED_FEATURES)
61 MACRO(PRINT_DISABLED_FEATURES)
62 _PRINT_FEATURES( DISABLED_FEATURES "Disabled features:")
63 ENDMACRO(PRINT_DISABLED_FEATURES)