Skip to content

Instantly share code, notes, and snippets.

@yossioo
Created June 23, 2019 06:11
Show Gist options
  • Save yossioo/e1deda44b28b5724f2a8e5d33bcf8a7e to your computer and use it in GitHub Desktop.
Save yossioo/e1deda44b28b5724f2a8e5d33bcf8a7e to your computer and use it in GitHub Desktop.
CMakeLists.txt search for variable
...
set(searchPattern "AMENT")
message(STATUS "========== Listing variables w/ search pattern: ${searchPattern}")
get_cmake_property(_variableNames VARIABLES)
list(SORT _variableNames)
foreach (_variableName ${_variableNames})
if (_variableName MATCHES .*${searchPattern}.*)
message(STATUS "${_variableName}=${${_variableName}}")
endif ()
endforeach ()
message(STATUS "Done =============")
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment