diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2007-02-25 21:13:33 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2007-02-25 21:13:33 (GMT) |
commit | 512d5dd1e3afb26302e5fa231a8b17f6274df528 (patch) | |
tree | 0d30e95865468b90ea5f22f00be8293c93e9deb3 /Source/cmLocalGenerator.cxx | |
parent | f0d5bdf86e46ca5cdeb32309904041439a0c5370 (diff) | |
download | CMake-512d5dd1e3afb26302e5fa231a8b17f6274df528.zip CMake-512d5dd1e3afb26302e5fa231a8b17f6274df528.tar.gz CMake-512d5dd1e3afb26302e5fa231a8b17f6274df528.tar.bz2 |
ENH: try and use \ for space and () escapes
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 834fe10..953a4f4 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2066,6 +2066,21 @@ 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 // that c:/some/path becomes /c/some/path. This is needed to // avoid problems with the shell path translation. @@ -2077,20 +2092,19 @@ std::string cmLocalGenerator::Convert(const char* source, result[0] = '/'; } } - if(this->WindowsShell) + // if this is unix then we need to escape () in the shell +#if !defined(WIN32) || defined(CYGWIN) + forceOn = true; +#endif + if(forceOn ) { - std::string::size_type pos = 0; - while((pos = result.find('/', pos)) != std::string::npos) - { - result[pos] = '\\'; - pos++; - } + result = cmSystemTools::EscapeForUnixShell(result); } - result = this->EscapeForShell(result.c_str(), true, false); } return result; } + //---------------------------------------------------------------------------- void cmLocalGenerator |