|
|
@@ -20,6 +20,8 @@
|
|
|
|
|
|
#include "cmSystemTools.h"
|
|
|
|
|
|
+#include <iterator>
|
|
|
+
|
|
|
#include <cm/optional>
|
|
|
#include <cmext/algorithm>
|
|
|
#include <cmext/string_view>
|
|
|
@@ -1614,6 +1616,17 @@ cm::optional<std::string> cmSystemTools::GetEnvVar(std::string const& var)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+std::vector<std::string> cmSystemTools::GetEnvPathNormalized(
|
|
|
+ std::string const& var)
|
|
|
+{
|
|
|
+ std::vector<std::string> result;
|
|
|
+ if (cm::optional<std::string> env = cmSystemTools::GetEnvVar(var)) {
|
|
|
+ std::vector<std::string> p = cmSystemTools::SplitEnvPathNormalized(*env);
|
|
|
+ std::move(p.begin(), p.end(), std::back_inserter(result));
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
std::vector<std::string> cmSystemTools::SplitEnvPath(cm::string_view in)
|
|
|
{
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|