1 # Helper functions for coupling add_feature_info() or CMAKE_DEPENDENT_OPTION() and option()
3 function(feature_option _name _description _default)
4 string(CONCAT _desc "${_description} (default: ${_default})")
5 option("${_name}" "${_desc}" "${_default}")
6 add_feature_info("${_name}" "${_name}" "${_desc}")
9 include(CMakeDependentOption)
10 function(feature_option_dependent _name _description _default_opt _dependency _default_dep_not_sat)
11 string(CONCAT _desc "${_description} (default: ${_default_opt}; depends on condition: ${_dependency})")
12 CMAKE_DEPENDENT_OPTION("${_name}" "${_desc}" "${_default_opt}" "${_dependency}" "${_default_dep_not_sat}")
13 add_feature_info("${_name}" "${_name}" "${_desc}")