CMake variables (variables provide information)

CMAKE_BINARY_DIR

 

The path to the top level of the build tree.
This is the full path to the top level of the current CMake build tree. For an in-source build, this would be the same as 
CMAKE_SOURCE_DIR. 简单来说就是执行cmake命令的执行目录。

CMAKE_CURRENT_BINARY_DIR

CMAKE_CURRENT_SOURCE_DIR

 

#add_subdirectory() will create a binary and a source directory in the build tree, and as it is being processed this variables
#will be set.
add_subdirectory(source_dir [binary_dir])
#Add a subdirectory(子路径) to the build.
#The source_dir specifies the directory in which the source CMakeLists.txt and code files are located.If it is a relative path
#it will be evaluated with respect to the current directory (the typical usage), but it may also be an absolute path.
#The binary_dir specifies the directory in which to place the output files. If it is a relative path it will be evaluated with
#respect to the current output directory, but it may also be an absolute path. If binary_dir is not specified, the value of
#source_dir, before expanding any relative path, will be used.

 

 

 

 

CMAKE_PROJECT_NAME

 

 

PROJECT_NAME

PROJECT_VERSION

PROJECT_BINARY_DIR

PROJECT_SOURCE_DIR

PROJECT_VERSION_MAJOR

PROJECT_VERSION_MINOR

PROJECT_VERSION_PATCH

PROJECT_VERSION_TWEAK

 

<PROJECT_NAME>_VERSION

<PROJECT_NAME>_SOURCE_DIR

<PROJECT_NAME>_BINARY_DIR

<PROJECT_NAME>_VERSION_MAJOR

<PROJECT_NAME>_VERSION_MINOR

 <PROJECT_NAME>_VERSION_PATCH

<PROJECT_NAME>_VERSION_TWEAK

 

Guess you like

Origin www.cnblogs.com/liuzhenbo/p/11184841.html