Merge topic 'fix-12445-add-call-for-batch-files-vs10'

46c7054 VS: Use "call " keyword with .cmd and .bat file custom commands (#12445)
This commit is contained in:
David Cole 2011-11-22 16:23:23 -05:00 committed by CMake Topic Stage
commit 636740c478
1 changed files with 14 additions and 0 deletions

View File

@ -250,6 +250,20 @@ cmLocalVisualStudioGenerator
// Add this command line.
std::string cmd = ccg.GetCommand(c);
// Use "call " before any invocations of .bat or .cmd files
// invoked as custom commands.
//
std::string suffix;
if (cmd.size() > 4)
{
suffix = cmSystemTools::LowerCase(cmd.substr(cmd.size()-4));
if (suffix == ".bat" || suffix == ".cmd")
{
script += "call ";
}
}
script += this->Convert(cmd.c_str(), relativeRoot, SHELL);
ccg.AppendArguments(c, script);