summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-05-13 12:54:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-05-13 12:54:08 (GMT)
commite00e67cb924495aab72bfc60dec0451a6566d8a2 (patch)
tree819b5e166e6ea748fea123af0075f40f9f1aa471 /Source
parentef7c0cb8856ed5629301ad925685c4281bcb9098 (diff)
parentba969ce5fe3a363b52dd4f0290e4b827272101fb (diff)
downloadCMake-e00e67cb924495aab72bfc60dec0451a6566d8a2.zip
CMake-e00e67cb924495aab72bfc60dec0451a6566d8a2.tar.gz
CMake-e00e67cb924495aab72bfc60dec0451a6566d8a2.tar.bz2
Merge topic 'presets-pathListSep'
ba969ce5fe cmake-presets: add ${pathListSep} macro Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7234
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCMakePresetsGraph.cxx7
-rw-r--r--Source/cmSystemTools.cxx9
-rw-r--r--Source/cmSystemTools.h3
3 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmCMakePresetsGraph.cxx b/Source/cmCMakePresetsGraph.cxx
index 478c175..b737c1f 100644
--- a/Source/cmCMakePresetsGraph.cxx
+++ b/Source/cmCMakePresetsGraph.cxx
@@ -361,6 +361,13 @@ bool ExpandMacros(const cmCMakePresetsGraph& graph, const T& preset,
cmSystemTools::GetParentDirectory(preset.OriginFile->Filename);
return ExpandMacroResult::Ok;
}
+ if (macroName == "pathListSep") {
+ if (version < 5) {
+ return ExpandMacroResult::Error;
+ }
+ macroOut += cmSystemTools::GetSystemPathlistSeparator();
+ return ExpandMacroResult::Ok;
+ }
}
return ExpandMacroResult::Ignore;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index cb32172..527175d 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -3429,3 +3429,12 @@ cm::string_view cmSystemTools::GetSystemName()
return "";
#endif
}
+
+char cmSystemTools::GetSystemPathlistSeparator()
+{
+#if defined(_WIN32)
+ return ';';
+#else
+ return ':';
+#endif
+}
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index c17ecbd..4865a4b 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -535,6 +535,9 @@ public:
/** Get the system name. */
static cm::string_view GetSystemName();
+ /** Get the system path separator character */
+ static char GetSystemPathlistSeparator();
+
private:
static bool s_ForceUnixPaths;
static bool s_RunCommandHideConsole;