diff options
author | Brad King <brad.king@kitware.com> | 2007-05-23 16:05:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-05-23 16:05:05 (GMT) |
commit | 702d785c9ae49015a770530a9c5f27e7bfaff716 (patch) | |
tree | 226ae4caef7654d169f0007405e892734471c1b4 /Source | |
parent | 2d051a67098333625a2c3f8a25b65936aa889239 (diff) | |
download | CMake-702d785c9ae49015a770530a9c5f27e7bfaff716.zip CMake-702d785c9ae49015a770530a9c5f27e7bfaff716.tar.gz CMake-702d785c9ae49015a770530a9c5f27e7bfaff716.tar.bz2 |
BUG: Add ./ to custom command executables in the top of the build tree even when the path is generated by target name replacement.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 08289ba..bd8949d 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -915,14 +915,17 @@ cmLocalUnixMakefileGenerator3 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); |