[cmake-commits] king committed cmLocalUnixMakefileGenerator3.cxx 1.210 1.211

cmake-commits at cmake.org cmake-commits at cmake.org
Wed May 23 12:05:07 EDT 2007


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

Modified Files:
	cmLocalUnixMakefileGenerator3.cxx 
Log Message:
BUG: Add ./ to custom command executables in the top of the build tree even when the path is generated by target name replacement.


Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -d -r1.210 -r1.211
--- cmLocalUnixMakefileGenerator3.cxx	22 May 2007 14:24:59 -0000	1.210
+++ cmLocalUnixMakefileGenerator3.cxx	23 May 2007 16:05:05 -0000	1.211
@@ -915,14 +915,17 @@
       cmSystemTools::ReplaceString(cmd, "/./", "/");
       // Convert the command to a relative path only if the current
       // working directory will be the start-output directory.
+      bool had_slash = cmd.find("/") != cmd.npos;
       if(!workingDir)
         {
         cmd = this->Convert(cmd.c_str(),START_OUTPUT);
         }
-      if(cmd.find("/") == cmd.npos &&
-         commandLine[0].find("/") != cmd.npos)
+      bool has_slash = cmd.find("/") != cmd.npos;
+      if(had_slash && !has_slash)
         {
-        // Add a leading "./" for executables in the current directory.
+        // This command was specified as a path to a file in the
+        // current directory.  Add a leading "./" so it can run
+        // without the current directory being in the search path.
         cmd = "./" + cmd;
         }
       cmd = this->Convert(cmd.c_str(),NONE,SHELL);



More information about the Cmake-commits mailing list