From 4c152752da0a896b849dfaefd2dabd591b324f38 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Sat, 17 Aug 2024 16:11:22 +1000 Subject: [PATCH] Help: State valid scopes for using proj_SOURCE_DIR and proj_BINARY_DIR Issue: #25714 --- Help/command/project.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Help/command/project.rst b/Help/command/project.rst index 2b938800c4..018829125d 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -33,10 +33,17 @@ Also sets the variables: Boolean value indicating whether the project is top-level. -Further variables are set by the optional arguments described in the following. -If any of these arguments is not used, then the corresponding variables are +Further variables are set by the optional arguments described in `Options`_ +further below. Where an option is not given, its corresponding variable is set to the empty string. +Note that variables of the form ``_SOURCE_DIR`` and ``_BINARY_DIR`` +may also be set by other commands before ``project()`` is called (see the +:command:`FetchContent_MakeAvailable` command for one example). +Projects should not rely on ``_SOURCE_DIR`` or +``_BINARY_DIR`` holding a particular value outside of the scope +of the call to ``project()`` or one of its child scopes. + Options ^^^^^^^