summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakePresetsGraph.h
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-08-31 13:41:42 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-08-31 14:13:32 (GMT)
commit215b9148eb0841224496e55f993b9ad7da55101e (patch)
treef9ecb25dbbfb75912017c2ea29e39ac4f2710218 /Source/cmCMakePresetsGraph.h
parent8bcc84283edff63d65a4f7364be0da927b8b8987 (diff)
downloadCMake-215b9148eb0841224496e55f993b9ad7da55101e.zip
CMake-215b9148eb0841224496e55f993b9ad7da55101e.tar.gz
CMake-215b9148eb0841224496e55f993b9ad7da55101e.tar.bz2
CMakePresets.json: Fix formatting of --list-presets=all
Only print an extra newline after a section if that section was actually printed.
Diffstat (limited to 'Source/cmCMakePresetsGraph.h')
-rw-r--r--Source/cmCMakePresetsGraph.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmCMakePresetsGraph.h b/Source/cmCMakePresetsGraph.h
index 4f3e108..efedc5b4 100644
--- a/Source/cmCMakePresetsGraph.h
+++ b/Source/cmCMakePresetsGraph.h
@@ -383,13 +383,22 @@ public:
return "";
}
+ enum class PrintPrecedingNewline
+ {
+ False,
+ True,
+ };
+ static void printPrecedingNewline(PrintPrecedingNewline* p);
+
static void PrintPresets(
const std::vector<const cmCMakePresetsGraph::Preset*>& presets);
- void PrintConfigurePresetList() const;
void PrintConfigurePresetList(
- const std::function<bool(const ConfigurePreset&)>& filter) const;
- void PrintBuildPresetList() const;
- void PrintTestPresetList() const;
+ PrintPrecedingNewline* newline = nullptr) const;
+ void PrintConfigurePresetList(
+ const std::function<bool(const ConfigurePreset&)>& filter,
+ PrintPrecedingNewline* newline = nullptr) const;
+ void PrintBuildPresetList(PrintPrecedingNewline* newline = nullptr) const;
+ void PrintTestPresetList(PrintPrecedingNewline* newline = nullptr) const;
void PrintAllPresets() const;
private: