BUG: Add ./ to custom command executables in the top of the build tree even when the path is generated by target name replacement.
This commit is contained in:
parent
2d051a6709
commit
702d785c9a
@ -915,14 +915,17 @@ cmLocalUnixMakefileGenerator3
|
|||||||
cmSystemTools::ReplaceString(cmd, "/./", "/");
|
cmSystemTools::ReplaceString(cmd, "/./", "/");
|
||||||
// Convert the command to a relative path only if the current
|
// Convert the command to a relative path only if the current
|
||||||
// working directory will be the start-output directory.
|
// working directory will be the start-output directory.
|
||||||
|
bool had_slash = cmd.find("/") != cmd.npos;
|
||||||
if(!workingDir)
|
if(!workingDir)
|
||||||
{
|
{
|
||||||
cmd = this->Convert(cmd.c_str(),START_OUTPUT);
|
cmd = this->Convert(cmd.c_str(),START_OUTPUT);
|
||||||
}
|
}
|
||||||
if(cmd.find("/") == cmd.npos &&
|
bool has_slash = cmd.find("/") != cmd.npos;
|
||||||
commandLine[0].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 = "./" + cmd;
|
||||||
}
|
}
|
||||||
cmd = this->Convert(cmd.c_str(),NONE,SHELL);
|
cmd = this->Convert(cmd.c_str(),NONE,SHELL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user