summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-03-08 16:49:26 (GMT)
committerBrad King <brad.king@kitware.com>2007-03-08 16:49:26 (GMT)
commit91c2b84a92a7cff0bbfc253e8937dd4832690bf7 (patch)
treec59ae8c2df8d717818fcca629f84708fd494a246 /Source/cmSystemTools.cxx
parent00051cf72162bfe04620e81794d15aeedc068db6 (diff)
downloadCMake-91c2b84a92a7cff0bbfc253e8937dd4832690bf7.zip
CMake-91c2b84a92a7cff0bbfc253e8937dd4832690bf7.tar.gz
CMake-91c2b84a92a7cff0bbfc253e8937dd4832690bf7.tar.bz2
ENH: Added ConvertToOutputSlashes method to convert slashes with the same policy as ConvertToOutputPath but without escaping.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 7af78fb..530d7fd 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1341,6 +1341,23 @@ std::string cmSystemTools::ConvertToOutputPath(const char* path)
#endif
}
+void cmSystemTools::ConvertToOutputSlashes(std::string& path)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if(!s_ForceUnixPaths)
+ {
+ // Convert to windows slashes.
+ std::string::size_type pos = 0;
+ while((pos = path.find('/', pos)) != std::string::npos)
+ {
+ path[pos++] = '\\';
+ }
+ }
+#else
+ static_cast<void>(path);
+#endif
+}
+
std::string cmSystemTools::ConvertToRunCommandPath(const char* path)
{
#if defined(_WIN32) && !defined(__CYGWIN__)