Created
February 8, 2022 14:01
-
-
Save Jawabiscuit/7926a04f4007b17a8e90bc5d792fa73b to your computer and use it in GitHub Desktop.
Prints all cmake variables or variables that match a regex.
This file contains hidden or 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
# https://stackoverflow.com/a/9328525 | |
function(dump_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