CMakeLists.txt中打印所有变量
一、打印可见变量及其值
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
二、打印环境变量及其值
execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "environment")