- CMAKE_BINARY_DIR : if you are building in-source,this is the same as CMAKE_SOURCE_DIR,otherwise this is the top level directory of your build tree
- CMAKE_COMMAND : this is the complete path of the cmake which runs currently (e.g.
/usr/local/bin/cmake
). Note that if you have custom commands that invokecmake -E
,it is very important to use CMAKE_COMMAND as the CMake executable,because CMake might not be on the system PATH.
- CMAKE_CURRENT_BINARY_DIR : if you are building in-source,this is the same as CMAKE_CURRENT_SOURCE_DIR,otherwise this is the directory where the compiled or generated files from the current CMakeLists.txt will go to.
- CMAKE_CURRENT_SOURCE_DIR : this is the directory where the currently processed CMakeLists.txt is located in
- CMAKE_CURRENT_LIST_FILE : this is the full path to the listfile currently being processed.
- CMAKE_CURRENT_LIST_DIR : (since 2.8.3) this is the directory of the listfile currently being processed.
- CMAKE_CURRENT_LIST_LINE : this is linenumber where the variable is used.
- CMAKE_FILES_DIRECTORY : the directory within the current binary directory that contains all the CMake generated files. Typically evaluates to "/CMakeFiles". Note the leading slash for the directory. Typically used with the current binary directory,i.e. ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}
- CMAKE_MODULE_PATH : tell CMake to search first in directories listed in CMAKE_MODULE_PATH when you use FIND_PACKAGE() or INCLUDE()
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/MyCMakeScripts)
FIND_PACKAGE(HelloWorld)
- CMAKE_ROOT : this is the CMake installation directory
- CMAKE_SOURCE_DIR : this is the directory which contains the top-level CMakeLists.txt,i.e. the top level source directory
- PROJECT_NAME : the name of the project set by PROJECT() command.
- CMAKE_PROJECT_NAME : the name of the first project set by the PROJECT() command,i.e. the top level project.
- PROJECT_BINARY_DIR : contains the full path to the top level directory of your build tree
- PROJECT_SOURCE_DIR : contains the full path to the root of your project source directory,i.e. to the nearest directory where CMakeLists.txt contains the PROJECT() command
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。