summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-11-18 15:15:58 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-11-18 15:15:58 (GMT)
commit46c70540ede37c5f2ebeeeba4178340abf92fadb (patch)
tree97f30d8f0563755b72ef3243ab6ee09e49070283 /Source/cmLocalVisualStudioGenerator.cxx
parent8e1bbee4d948025dfb1888e0a8b0365d7bd360c8 (diff)
downloadCMake-46c70540ede37c5f2ebeeeba4178340abf92fadb.zip
CMake-46c70540ede37c5f2ebeeeba4178340abf92fadb.tar.gz
CMake-46c70540ede37c5f2ebeeeba4178340abf92fadb.tar.bz2
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...
Diffstat (limited to 'Source/cmLocalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 4d16409..de1ac30 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);