diff options
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"$ |