summaryrefslogtreecommitdiffstats
path: root/Help/variable
diff options
context:
space:
mode:
authorNicolas Bock <nicolasbock@gmail.com>2020-04-27 21:46:38 (GMT)
committerCraig Scott <craig.scott@crascit.com>2020-04-29 13:17:41 (GMT)
commitbd6e437e3eaf609823c95beba4cb9cb3a1a40e65 (patch)
tree7dff403258daf89fe29723efcb6082bec599a12b /Help/variable
parent265fb71c917e3921012c2950a921cb380f60ae0f (diff)
downloadCMake-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.rst8
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).