Open junxnone opened 2 years ago
ONEAPI_ROOT
SET(VAR "/opt/xxx")
SET(ENV{VAR} "/opt/xxx")
${VAR}
$ENV{VAR}
PROJECT_NAME
CMAKE_INSTALL_PREFIX
/usr/local
c:/Program Files/${PROJECT_NAME}
CMAKE_MODULE_PATH
CMAKE_C_COMPILER
CMAKE_CXX_COMPILER
CMAKE_CXX_STANDARD
WIN32
1
False?None
CMAKE_SYSTEM_NAME
Windows
Linux
CMAKE_CURRENT_SOURCE_DIR
PROJECT_BINARY_DIR
变量
Reference
Brief
变量读写
ONEAPI_ROOT
SET(VAR "/opt/xxx")
SET(ENV{VAR} "/opt/xxx")
${VAR}
$ENV{VAR}
常用预定义变量
PROJECT_NAME
CMAKE_INSTALL_PREFIX
/usr/local
Windows Defaults:
c:/Program Files/${PROJECT_NAME}
CMAKE_MODULE_PATH
编译工具相关
CMAKE_C_COMPILER
CMAKE_CXX_COMPILER
CMAKE_CXX_STANDARD
OS 相关
WIN32
1
Linux:
False?None
CMAKE_SYSTEM_NAME
Windows
Linux:
Linux
目录相关
CMAKE_CURRENT_SOURCE_DIR
PROJECT_BINARY_DIR