diff options
author | David Cole <david.cole@kitware.com> | 2010-06-03 17:43:39 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2010-06-03 17:43:39 (GMT) |
commit | d093abef7e1b965cd6bc8a347852905d6c2b0913 (patch) | |
tree | 9c1dd2cb8531a843ca858bbee693eb96e0130b9a /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | e73ad22e384b392834614ab63c3d65543e78829a (diff) | |
download | CMake-d093abef7e1b965cd6bc8a347852905d6c2b0913.zip CMake-d093abef7e1b965cd6bc8a347852905d6c2b0913.tar.gz CMake-d093abef7e1b965cd6bc8a347852905d6c2b0913.tar.bz2 |
Fix failing ExternalProject test on Borland dashboards.
If there is a .bat or .cmd file used as a custom command
then the Borland Makefiles generator (specifically) requires
using the "call " syntax before the name of the .bat or .cmd
file. This fix applies to all Makefile based generators where
WindowsShell is true.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index fce5a9c..004d19a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -973,6 +973,24 @@ cmLocalUnixMakefileGenerator3 this->ConfigurationName.c_str()); if (cmd.size()) { + // Use "call " before any invocations of .bat or .cmd files + // invoked as custom commands in the WindowsShell. + // + bool useCall = false; + + if (this->WindowsShell) + { + std::string suffix; + if (cmd.size() > 4) + { + suffix = cmSystemTools::LowerCase(cmd.substr(cmd.size()-4)); + if (suffix == ".bat" || suffix == ".cmd") + { + useCall = true; + } + } + } + cmSystemTools::ReplaceString(cmd, "/./", "/"); // Convert the command to a relative path only if the current // working directory will be the start-output directory. @@ -1044,6 +1062,10 @@ cmLocalUnixMakefileGenerator3 } } } + if (useCall && launcher.empty()) + { + cmd = "call " + cmd; + } commands1.push_back(cmd); } } |