Skip to content

Instantly share code, notes, and snippets.

@deysumitkr
Created April 19, 2019 18:12
Show Gist options
  • Save deysumitkr/2eda28479aa5068e50cbd3c58ade37eb to your computer and use it in GitHub Desktop.
Save deysumitkr/2eda28479aa5068e50cbd3c58ade37eb to your computer and use it in GitHub Desktop.
List all variables available in cmake
# List all variables and values in cmake
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
# To print environment variables, use CMake's command mode:
execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "environment")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment