BUG: When a custom command's executable is in the current directory the relative path to it needs a "./".

This commit is contained in:
Brad King 2005-03-08 11:25:07 -05:00
parent f3a92bdfc7
commit d4a2000657
1 changed files with 7 additions and 1 deletions

View File

@ -2661,7 +2661,13 @@ cmLocalUnixMakefileGenerator2
const cmCustomCommandLine& commandLine = *cl; const cmCustomCommandLine& commandLine = *cl;
std::string cmd = commandLine[0]; std::string cmd = commandLine[0];
cmSystemTools::ReplaceString(cmd, "/./", "/"); 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) for(unsigned int j=1; j < commandLine.size(); ++j)
{ {
cmd += " "; cmd += " ";