diff options
author | Brad King <brad.king@kitware.com> | 2024-10-08 12:44:57 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-10-08 12:45:26 (GMT) |
commit | dc371e07fb55cb3c9745b1cf4cfeb8d09d6035f8 (patch) | |
tree | 81bbbde11a1bc338fe8fbb7f13827e83424e6743 /Help/command | |
parent | 1de987a7e9c0804b5b8d2bd8045725244cf167c2 (diff) | |
parent | fa07ddfebf69b5ea88799562ead7f6356e28ae01 (diff) | |
download | CMake-dc371e07fb55cb3c9745b1cf4cfeb8d09d6035f8.zip CMake-dc371e07fb55cb3c9745b1cf4cfeb8d09d6035f8.tar.gz CMake-dc371e07fb55cb3c9745b1cf4cfeb8d09d6035f8.tar.bz2 |
Merge topic 'project-vars'
fa07ddfebf project: Only check non-cache vars when setting project vars
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9883
Diffstat (limited to 'Help/command')
-rw-r--r-- | Help/command/project.rst | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Help/command/project.rst b/Help/command/project.rst index 08694fd..d220b83 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -44,11 +44,27 @@ Projects should not rely on ``<PROJECT-NAME>_SOURCE_DIR`` or ``<PROJECT-NAME>_BINARY_DIR`` holding a particular value outside of the scope of the call to ``project()`` or one of its child scopes. +.. versionchanged:: 3.30.3 + ``<PROJECT-NAME>_SOURCE_DIR``, ``<PROJECT-NAME>_BINARY_DIR``, and + ``<PROJECT-NAME>_IS_TOP_LEVEL`` are always set as non-cache variables by + ``project(<PROJECT-NAME> ...)``. + .. versionchanged:: 3.30.4 - If the variables ``<PROJECT-NAME>_SOURCE_DIR``, - ``<PROJECT-NAME>_BINARY_DIR``, or ``<PROJECT-NAME>_IS_TOP_LEVEL`` are - already set as non-cache variables when ``project(<PROJECT-NAME> ...)`` - is called, the ``project()`` command will overwrite the previous values. + The variables ``<PROJECT-NAME>_SOURCE_DIR``, ``<PROJECT-NAME>_BINARY_DIR``, + and ``<PROJECT-NAME>_IS_TOP_LEVEL`` are only set as non-cache variables if + they are already set as cache or non-cache variables when + ``project(<PROJECT-NAME> ...)`` is called. + Note that this logic is flawed, as it can result in different behavior + between the first and subsequent runs because cache variables won't exist + on the first run, but they will on subsequent runs. + +.. versionchanged:: 3.30.5 + The variables ``<PROJECT-NAME>_SOURCE_DIR``, ``<PROJECT-NAME>_BINARY_DIR``, + and ``<PROJECT-NAME>_IS_TOP_LEVEL`` are only set as non-cache variables if + they are already set as non-cache variables when + ``project(<PROJECT-NAME> ...)`` is called. + Unlike the flawed behavior of 3.30.4, non-cache variables will not be set + if only cache variables of the same name are set. Options ^^^^^^^ |