[cmake-commits] king committed cmLocalUnixMakefileGenerator3.cxx 1.195 1.196

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Mar 8 11:49:32 EST 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv21254

Modified Files:
	cmLocalUnixMakefileGenerator3.cxx 
Log Message:
ENH: Updated GetRecursiveMakeCall to use EscapeForShell instead of MAKEFILE conversion.  This code is special because it is the only place that a make target name is passed on a command line.


Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -d -r1.195 -r1.196
--- cmLocalUnixMakefileGenerator3.cxx	8 Mar 2007 16:10:21 -0000	1.195
+++ cmLocalUnixMakefileGenerator3.cxx	8 Mar 2007 16:49:30 -0000	1.196
@@ -1745,17 +1745,15 @@
   // Add the target.
   if (tgt && tgt[0] != '\0')
     {
-    std::string tgt2 = this->Convert(tgt,HOME_OUTPUT,MAKEFILE);
-    // 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)
-      {
-      cmSystemTools::ReplaceString(tgt2, "\\", "");
-      tgt2 = std::string("\"") + tgt2 + std::string("\"");
-      }
-    cmd += tgt2;
+    // The make target is always relative to the top of the build tree.
+    std::string tgt2 = this->Convert(tgt, HOME_OUTPUT);
+
+    // The target may have been written with windows paths.
+    cmSystemTools::ConvertToOutputSlashes(tgt2);
+
+    // The target name is now a string that should be passed verbatim
+    // on the command line.
+    cmd += this->EscapeForShell(tgt2.c_str(), true, false);
     }
   return cmd;
 }



More information about the Cmake-commits mailing list