CMakeLists.txt中打印所有变量

一、打印可见变量及其值

get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
    message(STATUS "${_variableName}=${${_variableName}}")
endforeach()

二、打印环境变量及其值

execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "environment")
posted @ 2022-10-11 17:49  半夜打老虎  阅读(583)  评论(0编辑  收藏  举报