From e86b9d33d0a5f957ae17ced82b530f99a3523737 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Fri, 20 May 2005 12:09:33 -0400 Subject: BUG: fix for empty custom commands --- Source/cmLocalUnixMakefileGenerator3.cxx | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index f5cf7cf..54dff68 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2527,24 +2527,27 @@ cmLocalUnixMakefileGenerator3 // Build the command line in a single string. const cmCustomCommandLine& commandLine = *cl; std::string cmd = commandLine[0]; - cmSystemTools::ReplaceString(cmd, "/./", "/"); - cmd = this->Convert(cmd.c_str(),START_OUTPUT); - if(cmd.find("/") == cmd.npos && - commandLine[0].find("/") != cmd.npos) + if (cmd.size()) { - // Add a leading "./" for executables in the current directory. - cmd = "./" + cmd; - } - cmd = this->Convert(cmd.c_str(),NONE,SHELL); - for(unsigned int j=1; j < commandLine.size(); ++j) - { - cmd += " "; - cmd += cmSystemTools::EscapeSpaces(commandLine[j].c_str()); + cmSystemTools::ReplaceString(cmd, "/./", "/"); + cmd = this->Convert(cmd.c_str(),START_OUTPUT); + if(cmd.find("/") == cmd.npos && + commandLine[0].find("/") != cmd.npos) + { + // Add a leading "./" for executables in the current directory. + cmd = "./" + cmd; + } + cmd = this->Convert(cmd.c_str(),NONE,SHELL); + for(unsigned int j=1; j < commandLine.size(); ++j) + { + cmd += " "; + cmd += cmSystemTools::EscapeSpaces(commandLine[j].c_str()); + } + + commands1.push_back(cmd); } - - commands1.push_back(cmd); } - + // stick this group of commands into a cd of the proper path // Build the jump-and-build command list. if(m_WindowsShell) -- cgit v0.12