summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator2.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-03-08 16:25:07 (GMT)
committerBrad King <brad.king@kitware.com>2005-03-08 16:25:07 (GMT)
commitd4a20006577ac58b6fc1268c5122721876dce64c (patch)
treea1af7ce9aa5a48124f146531c05807b238c80428 /Source/cmLocalUnixMakefileGenerator2.cxx
parentf3a92bdfc730d794bc4fcf5fbf53ba567b67fd6b (diff)
downloadCMake-d4a20006577ac58b6fc1268c5122721876dce64c.zip
CMake-d4a20006577ac58b6fc1268c5122721876dce64c.tar.gz
CMake-d4a20006577ac58b6fc1268c5122721876dce64c.tar.bz2
BUG: When a custom command's executable is in the current directory the relative path to it needs a "./".
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator2.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator2.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx
index 952cac0..55cde22 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 += " ";