diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-05-20 16:09:33 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-05-20 16:09:33 (GMT) |
commit | e86b9d33d0a5f957ae17ced82b530f99a3523737 (patch) | |
tree | a09b485c840af00c3c9fc162f0b11dcea3331cf9 | |
parent | 60bcce7fa2956d3017666cd8805979b40ef1523b (diff) | |
download | CMake-e86b9d33d0a5f957ae17ced82b530f99a3523737.zip CMake-e86b9d33d0a5f957ae17ced82b530f99a3523737.tar.gz CMake-e86b9d33d0a5f957ae17ced82b530f99a3523737.tar.bz2 |
BUG: fix for empty custom commands
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 33 |
1 files 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) |