cmake官方文档-cmake-variables(7)

cmake-variables(7)

在cmake帮助文档 https://cmake.org/cmake/help/v3.19/index.html 中点击 cmake-variables(7) 链接:

 

 

 

https://cmake.org/cmake/help/v3.19/manual/cmake-variables.7.html

Contents

 =======================================

https://cmake.org/cmake/help/v3.19/variable/CMAKE_CURRENT_SOURCE_DIR.html

========================================

CMAKE_CURRENT_SOURCE_DIR

The path to the source directory currently being processed.

This the full path to the source directory that is currently being processed by cmake.

When run in -P script mode, CMake sets the variables CMAKE_BINARY_DIRCMAKE_SOURCE_DIRCMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR to the current working directory.

 =======================================

https://cmake.org/cmake/help/v3.19/variable/CMAKE_CURRENT_LIST_DIR.html

========================================

CMAKE_CURRENT_LIST_DIR

Full directory of the listfile currently being processed.

As CMake processes the listfiles in your project this variable will always be set to the directory where the listfile which is currently being processed (CMAKE_CURRENT_LIST_FILE) is located. The value has dynamic scope. When CMake starts processing commands in a source file it sets this variable to the directory where this file is located. When CMake finishes processing commands from the file it restores the previous value. Therefore the value of the variable inside a macro or function is the directory of the file invoking the bottom-most entry on the call stack, not the directory of the file containing the macro or function definition.

See also CMAKE_CURRENT_LIST_FILE.

 =======================================

https://cmake.org/cmake/help/v3.19/variable/CMAKE_CURRENT_LIST_FILE.html

========================================

CMAKE_CURRENT_LIST_FILE

Full path to the listfile currently being processed.

As CMake processes the listfiles in your project this variable will always be set to the one currently being processed. The value has dynamic scope. When CMake starts processing commands in a source file it sets this variable to the location of the file. When CMake finishes processing commands from the file it restores the previous value. Therefore the value of the variable inside a macro or function is the file invoking the bottom-most entry on the call stack, not the file containing the macro or function definition.

See also CMAKE_PARENT_LIST_FILE.

 =======================================

https://cmake.org/cmake/help/v3.19/variable/CMAKE_BINARY_DIR.html

========================================

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.

When run in -P script mode, CMake sets the variables CMAKE_BINARY_DIRCMAKE_SOURCE_DIRCMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR to the current working directory.

 =======================================

========================================

CMAKE_SOURCE_DIR

The path to the top level of the source tree.

This is the full path to the top level of the current CMake source tree. For an in-source build, this would be the same as CMAKE_BINARY_DIR.

When run in -P script mode, CMake sets the variables CMAKE_BINARY_DIR, CMAKE_SOURCE_DIR, CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR to the current working directory.

 

posted @ 2021-02-19 21:32  py2020  阅读(119)  评论(1)    收藏  举报