CMAKE_MESSAGE_LOG_LEVEL

在 3.17 版本中添加。

当设置此变量时,它指定了 message() 命令所使用的日志级别。有效值与 cmake(1) 程序的 --log-level 命令行选项的值相同。如果设置了此变量并且提供了 --log-level 命令行选项,则命令行选项具有优先权。

使用此变量的主要优点是可以使日志级别在 CMake 运行之间持久化。将其设置为缓存变量将确保后续的 CMake 运行将继续使用选定的日志级别。

项目不应设置此变量,它 intended for users so that they may control the log level according to their own needs. (本项目不应设置此变量,它 intended for users so that they may control the log level according to their own needs.)

Added in version 3.25: See the cmake_language() cmake_language command for a way to query the current message logging level. (请参阅 cmake_language() 命令的 cmake_language 以查询当前的日志记录级别。)