CMakePrintSystemInformation¶
此模块可用于诊断并打印系统信息。
在 CMake 项目中加载此模块,使用
include(CMakePrintSystemInformation)
示例¶
例如,在项目中包含此模块
CMakeLists.txt¶project(Example)
# ...
include(CMakePrintSystemInformation)
将打印各种 CMake 变量
CMAKE_SYSTEM is Linux-6.11.0-17-generic Linux 6.11.0-17-generic x86_64
CMAKE_SYSTEM file is Platform/Linux
CMAKE_C_COMPILER is /usr/bin/cc
CMAKE_CXX_COMPILER is /usr/bin/c++
CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is -shared
CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is -shared
...