summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.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/cmLocalUnixMakefileGenerator3.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/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index e5036b3..e86fe57 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1776,14 +1776,15 @@ cmLocalUnixMakefileGenerator3
if (tgt && tgt[0] != '\0')
{
std::string tgt2 = this->Convert(tgt,HOME_OUTPUT,MAKEFILE);
- tgt2 = this->ConvertToMakeTarget(tgt2.c_str());
- bool forceOn = cmSystemTools::GetForceUnixPaths();
-#if !defined(WIN32) || defined(CYGWIN)
- forceOn = true;
-#endif
- if(forceOn )
+ tgt2 = this->ConvertToMakeTarget(tgt2.c_str());
+ // for make -f foo bar, foo is a file but bar (tgt2) is
+ // a make target. make targets should be escaped with ""
+ // and not \, so if we find a "\ " in the path then remove
+ // the \ and quote the whole string
+ if(tgt2.find("\\ ") != tgt2.npos)
{
- tgt2 = cmSystemTools::EscapeForUnixShell(tgt2);
+ cmSystemTools::ReplaceString(tgt2, "\\", "");
+ tgt2 = std::string("\"") + tgt2 + std::string("\"");
}
cmd += tgt2;
}