diff options
author | Brad King <brad.king@kitware.com> | 2021-04-08 11:49:32 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-04-08 11:49:56 (GMT) |
commit | 21f0478ade327c41c011de4b2336f8ad113d400f (patch) | |
tree | d6ec7b0ce95e34a7513368d6c8a4f72d7fa06f5b /Source/cmake.cxx | |
parent | a0e5998bd640b511d75d8d75ed95eb801485f80f (diff) | |
parent | 06e69813360560347434a5320f1a366ba004e033 (diff) | |
download | CMake-21f0478ade327c41c011de4b2336f8ad113d400f.zip CMake-21f0478ade327c41c011de4b2336f8ad113d400f.tar.gz CMake-21f0478ade327c41c011de4b2336f8ad113d400f.tar.bz2 |
Merge topic 'presets-optional-generator-and-builddir'
06e6981336 cmake-presets: Make generator and binaryDir fields optional
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5946
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a04338f..1d4bbf4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1223,10 +1223,11 @@ void cmake::SetArgs(const std::vector<std::string>& args) return; } - if (!this->State->IsCacheLoaded() && !haveBArg) { + if (!this->State->IsCacheLoaded() && !haveBArg && + !expandedPreset->BinaryDir.empty()) { this->SetHomeOutputDirectory(expandedPreset->BinaryDir); } - if (!this->GlobalGenerator) { + if (!this->GlobalGenerator && !expandedPreset->Generator.empty()) { if (!this->CreateAndSetGlobalGenerator(expandedPreset->Generator, false)) { return; @@ -3203,7 +3204,9 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets, return 1; } - dir = expandedConfigurePreset->BinaryDir; + if (!expandedConfigurePreset->BinaryDir.empty()) { + dir = expandedConfigurePreset->BinaryDir; + } this->UnprocessedPresetEnvironment = expandedPreset->Environment; this->ProcessPresetEnvironment(); |