From 46c70540ede37c5f2ebeeeba4178340abf92fadb Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 18 Nov 2011 10:15:58 -0500 Subject: [PATCH] VS: Use "call " keyword with .cmd and .bat file custom commands (#12445) Similar fix to commit d093abef for the Makefile generators. Prevents premature exit from sequence of commands. Even when no errors occur, the previous construct without "call " was exiting the sequence before executing the full set of commands... --- Source/cmLocalVisualStudioGenerator.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index 4d1640971..de1ac30fe 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -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);