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:46 (GMT) |
commit | 105ef112c990df78869a37f0b045087d3b0c900f (patch) | |
tree | 54985ff89210bbd426cde0228d1d62e25c355d4f /Source/cmake.cxx | |
parent | c79e02c4c3acb16d81d1b940074853f653634546 (diff) | |
parent | b7d7eca66db97f9dcb6068762733f06941c0c05a (diff) | |
download | CMake-105ef112c990df78869a37f0b045087d3b0c900f.zip CMake-105ef112c990df78869a37f0b045087d3b0c900f.tar.gz CMake-105ef112c990df78869a37f0b045087d3b0c900f.tar.bz2 |
Merge topic 'cmake-presets-path-arg'
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 de3025b..7a9e493 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) { |