diff options
author | Nicolas Bock <nicolasbock@gmail.com> | 2020-04-27 21:46:38 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2020-04-29 13:17:41 (GMT) |
commit | bd6e437e3eaf609823c95beba4cb9cb3a1a40e65 (patch) | |
tree | 7dff403258daf89fe29723efcb6082bec599a12b /Help/variable | |
parent | 265fb71c917e3921012c2950a921cb380f60ae0f (diff) | |
download | CMake-bd6e437e3eaf609823c95beba4cb9cb3a1a40e65.zip CMake-bd6e437e3eaf609823c95beba4cb9cb3a1a40e65.tar.gz CMake-bd6e437e3eaf609823c95beba4cb9cb3a1a40e65.tar.bz2 |
Help: Clarify the use of PROJECT_SOURCE_DIR
The value of the PROJECT_SOURCE_DIR variable is not always the source
directory of the "most recent project command". If the project was
included via add_subdirectory, variable scoping will prevent this
value to change in the parent scope.
Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
Diffstat (limited to 'Help/variable')
-rw-r--r-- | Help/variable/PROJECT_SOURCE_DIR.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Help/variable/PROJECT_SOURCE_DIR.rst b/Help/variable/PROJECT_SOURCE_DIR.rst index 27f2838..b4601c2 100644 --- a/Help/variable/PROJECT_SOURCE_DIR.rst +++ b/Help/variable/PROJECT_SOURCE_DIR.rst @@ -1,6 +1,8 @@ PROJECT_SOURCE_DIR ------------------ -Top level source directory for the current project. - -This is the source directory of the most recent :command:`project` command. +This is the source directory of the last call to the +:command:`project` command made in the current directory scope or one +of its parents. Note, it is not affected by calls to +:command:`project` made within a child directory scope (i.e. from +within a call to :command:`add_subdirectory` from the current scope). |