diff options
author | Brad King <brad.king@kitware.com> | 2021-07-07 13:27:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-07 13:27:45 (GMT) |
commit | 4564c5a77ebd721144411404c69d45ab34b9722d (patch) | |
tree | b5faa7057676d002dcefc6cbe07daf2ce5853abe | |
parent | 19cd773c44d645a0a98ea5f58ffb0ce292622ec6 (diff) | |
parent | d9a3c9fad52a522da0dcc8093770fb9e59a1e21e (diff) | |
download | CMake-4564c5a77ebd721144411404c69d45ab34b9722d.zip CMake-4564c5a77ebd721144411404c69d45ab34b9722d.tar.gz CMake-4564c5a77ebd721144411404c69d45ab34b9722d.tar.bz2 |
Merge topic 'cmake-presets-list-no-generator' into release-3.21
d9a3c9fad5 CMakePresets.json: Make --list-presets show presets with no generator
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6314
6 files changed, 23 insertions, 13 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 14f66d9..73f5ad5 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1687,6 +1687,9 @@ void cmake::PrintPresetList(const cmCMakePresetsFile& file) const this->GetRegisteredGenerators(generators, false); auto filter = [&generators](const cmCMakePresetsFile::ConfigurePreset& preset) -> bool { + if (preset.Generator.empty()) { + return true; + } auto condition = [&preset](const GeneratorInfo& info) -> bool { return info.name == preset.Generator; }; diff --git a/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt index 60d6adb..97eedae 100644 --- a/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt +++ b/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt @@ -1,6 +1,7 @@ ^Not searching for unused variables given on the command line\. Available configure presets: - "zzzzzz" - Sleepy - "aaaaaaaa" - Screaming - "mmmmmm"$ + "zzzzzz" - Sleepy + "aaaaaaaa" - Screaming + "mmmmmm" + "no-generator"$ diff --git a/Tests/RunCMake/CMakePresets/ListPresets.json.in b/Tests/RunCMake/CMakePresets/ListPresets.json.in index 2ef3797..160098c 100644 --- a/Tests/RunCMake/CMakePresets/ListPresets.json.in +++ b/Tests/RunCMake/CMakePresets/ListPresets.json.in @@ -1,5 +1,5 @@ { - "version": 1, + "version": 3, "configurePresets": [ { "name": "zzzzzz", @@ -19,6 +19,9 @@ "binaryDir": "${sourceDir}/build/mmmmmm" }, { + "name": "no-generator" + }, + { "name": "invalid-generator", "generator": "Invalid Generator", "binaryDir": "${sourceDir}/build/invalid" diff --git a/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt index 60d6adb..97eedae 100644 --- a/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt +++ b/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt @@ -1,6 +1,7 @@ ^Not searching for unused variables given on the command line\. Available configure presets: - "zzzzzz" - Sleepy - "aaaaaaaa" - Screaming - "mmmmmm"$ + "zzzzzz" - Sleepy + "aaaaaaaa" - Screaming + "mmmmmm" + "no-generator"$ diff --git a/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt index 60d6adb..97eedae 100644 --- a/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt +++ b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt @@ -1,6 +1,7 @@ ^Not searching for unused variables given on the command line\. Available configure presets: - "zzzzzz" - Sleepy - "aaaaaaaa" - Screaming - "mmmmmm"$ + "zzzzzz" - Sleepy + "aaaaaaaa" - Screaming + "mmmmmm" + "no-generator"$ diff --git a/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt index 60d6adb..97eedae 100644 --- a/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt +++ b/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt @@ -1,6 +1,7 @@ ^Not searching for unused variables given on the command line\. Available configure presets: - "zzzzzz" - Sleepy - "aaaaaaaa" - Screaming - "mmmmmm"$ + "zzzzzz" - Sleepy + "aaaaaaaa" - Screaming + "mmmmmm" + "no-generator"$ |