diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-10-27 11:33:37 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-27 11:33:45 (GMT) |
commit | 698851cdb7e49c2705898a71b2eaf96ca70b9ad5 (patch) | |
tree | cdc361b069054bc6fea4a391e6f7dcf75dd15591 /Source/cmake.cxx | |
parent | 96ea613f169cedc4087b536d95ca6c128b8f4eb6 (diff) | |
parent | b7d7eca66db97f9dcb6068762733f06941c0c05a (diff) | |
download | CMake-698851cdb7e49c2705898a71b2eaf96ca70b9ad5.zip CMake-698851cdb7e49c2705898a71b2eaf96ca70b9ad5.tar.gz CMake-698851cdb7e49c2705898a71b2eaf96ca70b9ad5.tar.bz2 |
Merge topic 'cmake-presets-path-arg' into release-3.19
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5416
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 45d6d6c..f4ab1b0 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -727,6 +727,7 @@ void cmake::SetArgs(const std::vector<std::string>& args) { bool haveToolset = false; bool havePlatform = false; + bool haveBArg = false; #if !defined(CMAKE_BOOTSTRAP) std::string profilingFormat; std::string profilingOutput; @@ -775,6 +776,7 @@ void cmake::SetArgs(const std::vector<std::string>& args) path = cmSystemTools::CollapseFullPath(path); cmSystemTools::ConvertToUnixSlashes(path); this->SetHomeOutputDirectory(path); + haveBArg = true; } else if ((i < args.size() - 2) && cmHasLiteralPrefix(arg, "--check-build-system")) { this->CheckBuildSystemArgument = args[++i]; @@ -1057,7 +1059,7 @@ void cmake::SetArgs(const std::vector<std::string>& args) return; } - if (!haveBinaryDir) { + if (!this->State->IsCacheLoaded() && !haveBArg) { this->SetHomeOutputDirectory(expandedPreset->BinaryDir); } if (!this->GlobalGenerator) { |