diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-11-02 14:26:51 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-11-02 14:46:08 (GMT) |
commit | cb2d01c182d31d890990c2bcde1766d4fc65a318 (patch) | |
tree | 0247aa5851575e9bf7db22afa9db74e88060d7b9 /Source/cmake.cxx | |
parent | 013c4133f79d0bd5e82254d0dfdfa42a6c8dfcc8 (diff) | |
download | CMake-cb2d01c182d31d890990c2bcde1766d4fc65a318.zip CMake-cb2d01c182d31d890990c2bcde1766d4fc65a318.tar.gz CMake-cb2d01c182d31d890990c2bcde1766d4fc65a318.tar.bz2 |
CMakePresets.json: Don't warn if no path argument is given
If --preset is specified with no path argument, use the current
directory as the source directory, the preset's binaryDir as the
binary directory, and don't issue the standard warning for no path
specified.
Fixes: #21386
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f4ab1b0..60a493c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1005,9 +1005,15 @@ void cmake::SetArgs(const std::vector<std::string>& args) const bool haveSourceDir = !this->GetHomeDirectory().empty(); const bool haveBinaryDir = !this->GetHomeOutputDirectory().empty(); + const bool havePreset = +#ifdef CMAKE_BOOTSTRAP + false; +#else + !presetName.empty(); +#endif if (this->CurrentWorkingMode == cmake::NORMAL_MODE && !haveSourceDir && - !haveBinaryDir) { + !haveBinaryDir && !havePreset) { this->IssueMessage( MessageType::WARNING, "No source or binary directory provided. Both will be assumed to be " |