summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-02-28 19:29:26 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-02-28 19:29:26 (GMT)
commitecbec236b1fae48bfe625338fff3b0cd1e70714c (patch)
treeee327084678391d91a1bb03c7a3dd0c19db7839b /Source/cmLocalGenerator.cxx
parent56e3a35ece5f4db276bd02c9849e7b58ca479970 (diff)
downloadCMake-ecbec236b1fae48bfe625338fff3b0cd1e70714c.zip
CMake-ecbec236b1fae48bfe625338fff3b0cd1e70714c.tar.gz
CMake-ecbec236b1fae48bfe625338fff3b0cd1e70714c.tar.bz2
ENH: one more pass at paths with spaces and parens
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx31
1 files changed, 9 insertions, 22 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 953a4f4..57376ff 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2066,22 +2066,7 @@ std::string cmLocalGenerator::Convert(const char* source,
}
if( output == SHELL)
{
- // for shell commands if force unix is on, but this->WindowsShell
- // is true, then turn off force unix paths for the output path
- // so that the path is windows style and will work with windows
- // cmd.exe.
- bool forceOn = cmSystemTools::GetForceUnixPaths();
- if(forceOn && this->WindowsShell)
- {
- cmSystemTools::SetForceUnixPaths(false);
- }
- result = cmSystemTools::ConvertToOutputPath(result.c_str());
- if(forceOn && this->WindowsShell)
- {
- cmSystemTools::SetForceUnixPaths(true);
- }
-
- // For the MSYS shell convert drive letters to posix paths, so
+ // For the MSYS shell convert drive letters to posix paths, so
// that c:/some/path becomes /c/some/path. This is needed to
// avoid problems with the shell path translation.
if(this->MSYSShell)
@@ -2092,14 +2077,16 @@ std::string cmLocalGenerator::Convert(const char* source,
result[0] = '/';
}
}
- // if this is unix then we need to escape () in the shell
-#if !defined(WIN32) || defined(CYGWIN)
- forceOn = true;
-#endif
- if(forceOn )
+ if(this->WindowsShell)
{
- result = cmSystemTools::EscapeForUnixShell(result);
+ std::string::size_type pos = 0;
+ while((pos = result.find('/', pos)) != std::string::npos)
+ {
+ result[pos] = '\\';
+ pos++;
+ }
}
+ result = this->EscapeForShell(result.c_str(), true, false);
}
return result;
}