CMake: Print out all accessible variables in a script
Using the get_cmake_property function, the following loop will print out all CMake variables defined and their values: get_cmake_property(_variableNames VARIABLES) list (SORT _variableNames) foreach (_variableName ${_variableNames}) message(STATUS “${_variableName}=${${_variableName}}”) endforeach() This can also be embedded in a convenience function which can optionally use a regular expression to print only a subset of variables with matching names function(dump_cmake_variables) … Read more