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.
This commit is contained in:
David Cole 2010-06-03 13:43:39 -04:00
parent e73ad22e38
commit d093abef7e
1 changed files with 22 additions and 0 deletions

View File

@ -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);
}
}