diff options
author | Brad King <brad.king@kitware.com> | 2017-09-11 11:53:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-11 11:53:18 (GMT) |
commit | 28adf3833c23411dfce12b5be754ad53bc2b9b05 (patch) | |
tree | 00cd2f817a879541d0b290f322c56c5be06dc3b9 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | bf19bb5609b409c9c4043b22a7bbdb38354af73a (diff) | |
parent | 9ed242807893becd4cd8245248fade93f7054c71 (diff) | |
download | CMake-28adf3833c23411dfce12b5be754ad53bc2b9b05.zip CMake-28adf3833c23411dfce12b5be754ad53bc2b9b05.tar.gz CMake-28adf3833c23411dfce12b5be754ad53bc2b9b05.tar.bz2 |
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
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 7fe2f2a..bd3e82d 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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) { |