diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2024-08-27 15:59:46 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2024-08-27 16:37:07 (GMT) |
commit | c1ece78d113d39cdfb3c875d726e296c15abe4a8 (patch) | |
tree | 8b983201b5ec195cec84b8e6bc149ca2933e38d1 /Source | |
parent | 0e217de3437699cb1133a04fb1670489378e22dd (diff) | |
download | CMake-c1ece78d113d39cdfb3c875d726e296c15abe4a8.zip CMake-c1ece78d113d39cdfb3c875d726e296c15abe4a8.tar.gz CMake-c1ece78d113d39cdfb3c875d726e296c15abe4a8.tar.bz2 |
project: non cache <project> prefix variables are also created
Fixes #26243, #25714
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmProjectCommand.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 53166c1..13070dd 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -59,9 +59,14 @@ bool cmProjectCommand(std::vector<std::string> const& args, mf.AddCacheDefinition(projectName + "_BINARY_DIR", mf.GetCurrentBinaryDirectory(), "Value Computed by CMake", cmStateEnums::STATIC); + mf.AddDefinition(projectName + "_BINARY_DIR", + mf.GetCurrentBinaryDirectory()); + mf.AddCacheDefinition(projectName + "_SOURCE_DIR", mf.GetCurrentSourceDirectory(), "Value Computed by CMake", cmStateEnums::STATIC); + mf.AddDefinition(projectName + "_SOURCE_DIR", + mf.GetCurrentSourceDirectory()); mf.AddDefinition("PROJECT_BINARY_DIR", mf.GetCurrentBinaryDirectory()); mf.AddDefinition("PROJECT_SOURCE_DIR", mf.GetCurrentSourceDirectory()); @@ -72,6 +77,8 @@ bool cmProjectCommand(std::vector<std::string> const& args, mf.AddCacheDefinition(projectName + "_IS_TOP_LEVEL", mf.IsRootMakefile() ? "ON" : "OFF", "Value Computed by CMake", cmStateEnums::STATIC); + mf.AddDefinition(projectName + "_IS_TOP_LEVEL", + mf.IsRootMakefile() ? "ON" : "OFF"); // Set the CMAKE_PROJECT_NAME variable to be the highest-level // project name in the tree. If there are two project commands |