Last active
June 5, 2022 04:03
-
-
Save sighingnow/c8e153cd6cbd6b0084b36aa5f75db09d to your computer and use it in GitHub Desktop.
Print all accessible variables in current context in CMake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(print_cmake_variables) | |
get_cmake_property(_variableNames VARIABLES) | |
list (SORT _variableNames) | |
foreach (_variableName ${_variableNames}) | |
if (ARGV0) | |
unset(MATCHED) | |
string(REGEX MATCH ${ARGV0} MATCHED ${_variableName}) | |
if (NOT MATCHED) | |
continue() | |
endif() | |
endif() | |
message(STATUS "${_variableName}=${${_variableName}}") | |
endforeach() | |
endfunction() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment