CMakePresets.json: Make --list-presets show presets with no generator

Fixes: #22389
This commit is contained in:
Kyle Edwards 2021-07-06 14:36:27 -04:00
parent 13fa970149
commit d9a3c9fad5
6 changed files with 23 additions and 13 deletions

View File

@ -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;
};

View File

@ -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"$

View File

@ -1,5 +1,5 @@
{
"version": 1,
"version": 3,
"configurePresets": [
{
"name": "zzzzzz",
@ -18,6 +18,9 @@
"generator": "@RunCMake_GENERATOR@",
"binaryDir": "${sourceDir}/build/mmmmmm"
},
{
"name": "no-generator"
},
{
"name": "invalid-generator",
"generator": "Invalid Generator",

View File

@ -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"$

View File

@ -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"$

View File

@ -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"$