diff options
author | Brad King <brad.king@kitware.com> | 2022-05-13 12:54:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-05-13 12:54:08 (GMT) |
commit | e00e67cb924495aab72bfc60dec0451a6566d8a2 (patch) | |
tree | 819b5e166e6ea748fea123af0075f40f9f1aa471 /Source | |
parent | ef7c0cb8856ed5629301ad925685c4281bcb9098 (diff) | |
parent | ba969ce5fe3a363b52dd4f0290e4b827272101fb (diff) | |
download | CMake-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.cxx | 7 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 9 | ||||
-rw-r--r-- | Source/cmSystemTools.h | 3 |
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; |