From d4a20006577ac58b6fc1268c5122721876dce64c Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 8 Mar 2005 11:25:07 -0500 Subject: [PATCH] BUG: When a custom command's executable is in the current directory the relative path to it needs a "./". --- Source/cmLocalUnixMakefileGenerator2.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx index 952cac058..55cde2265 100644 --- a/Source/cmLocalUnixMakefileGenerator2.cxx +++ b/Source/cmLocalUnixMakefileGenerator2.cxx @@ -2661,7 +2661,13 @@ cmLocalUnixMakefileGenerator2 const cmCustomCommandLine& commandLine = *cl; std::string cmd = commandLine[0]; cmSystemTools::ReplaceString(cmd, "/./", "/"); - cmd = this->ConvertToRelativeOutputPath(cmd.c_str()); + cmd = this->ConvertToRelativePath(cmd.c_str()); + if(cmd.find("/") == cmd.npos) + { + // Add a leading "./" for executables in the current directory. + cmd = "./" + cmd; + } + cmd = cmSystemTools::ConvertToOutputPath(cmd.c_str()); for(unsigned int j=1; j < commandLine.size(); ++j) { cmd += " ";