summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython/Python2SABIModule
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2024-09-15 07:46:37 (GMT)
committerBrad King <brad.king@kitware.com>2024-09-20 14:33:25 (GMT)
commit86ad7cc886cf477514689c44e02739401cd52402 (patch)
tree2c3d98f30e6b56431477ddfbee7ff8f84a15b91d /Tests/FindPython/Python2SABIModule
parent4c152752da0a896b849dfaefd2dabd591b324f38 (diff)
downloadCMake-86ad7cc886cf477514689c44e02739401cd52402.zip
CMake-86ad7cc886cf477514689c44e02739401cd52402.tar.gz
CMake-86ad7cc886cf477514689c44e02739401cd52402.tar.bz2
project: Only define non-cache vars if already defined
In c1ece78d11 (project: non cache <project> prefix variables are also created, 2024-08-27), we started explicitly setting the non-cache variable for <projectName>_SOURCE_DIR, <projectName>_BINARY_DIR, and <projectName>_IS_TOP_LEVEL in addition to setting them as cache variables. This changed the behavior when a project name was used more than once, and the second project call happens in the same scope or a child scope of the first. Previously, the first project call would set cache variables, and the second project call would not overwrite those cache variables. With the change in c1ece78d11, after the second project call the non-cache variables would mask the cache variables and the project code would see a different value to what it did before. Setting the non-cache variable was added to handle the case where a call to FetchContent_MakeAvailable() would set some non-cache variables, and it just so happened those matched the same cache variables that the project() command would set in the project being fetched. The fetched project would then see a different set of project-specific variables compared to when it was built standalone. This commit here narrows the change from c1ece78d11 such that the non-cache variable is only set by project() if there was already a non-cache variable set. This still fixes the motivating problem c1ece78d11 was intended to solve, but it avoids changing the variable values seen by a project that re-uses the same project name in related scopes. Issue: #26243, #25714 Fixes: #26281
Diffstat (limited to 'Tests/FindPython/Python2SABIModule')
0 files changed, 0 insertions, 0 deletions