Merge topic 'vs_improve_custom_command'

9ed24280 VS: only add custom command line if it is not empty
34c4108b add HasOnlyEmptyCommandLines() method to cmCustomCommandGenerator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1050
This commit is contained in:
Brad King
2017-09-11 11:53:00 +00:00
committed by Kitware Robot
8 changed files with 126 additions and 8 deletions
+7 -5
View File
@@ -3536,11 +3536,13 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
for (std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i) {
cmCustomCommandGenerator ccg(*i, configName, this->LocalGenerator);
comment += pre;
comment += lg->ConstructComment(ccg);
script += pre;
pre = "\n";
script += cmVS10EscapeXML(lg->ConstructScript(ccg));
if (!ccg.HasOnlyEmptyCommandLines()) {
comment += pre;
comment += lg->ConstructComment(ccg);
script += pre;
pre = "\n";
script += cmVS10EscapeXML(lg->ConstructScript(ccg));
}
}
comment = cmVS10EscapeComment(comment);
if (this->ProjectType != csproj) {