一、打印可见变量及其值
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
二、打印环境变量及其值
execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "environment")
标签:CMakeLists,打印,variableNames,COMMAND,txt,variableName
From: https://www.cnblogs.com/xiaxuexiaoab/p/16780057.html