diff options
author | Frank Goyens <frank.goyens@delem.com> | 2018-06-29 13:41:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-07-09 11:39:39 (GMT) |
commit | b771b2c3001e2137293de4197a8567e5cd9f6466 (patch) | |
tree | 7a8820ab087e010aa75127fc650446edd149b4e4 /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 2f4075fa45a180dce701295dbabb131518652221 (diff) | |
download | CMake-b771b2c3001e2137293de4197a8567e5cd9f6466.zip CMake-b771b2c3001e2137293de4197a8567e5cd9f6466.tar.gz CMake-b771b2c3001e2137293de4197a8567e5cd9f6466.tar.bz2 |
VS: extended OutputDeploymentDebuggerTool for AdditionalFiles
The `OutputDeploymentDebuggerTool` function now also retrieves a target
property that is used for setting the `AdditionalFiles` attribute of
`DeploymentTool`.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 2c1a95c..c90c5b8 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1245,30 +1245,44 @@ static std::string cmLocalVisualStudio7GeneratorEscapeForXML( return ret; } +static std::string GetEscapedPropertyIfValueNotNULL(const char* propertyValue) +{ + return propertyValue == nullptr + ? std::string() + : cmLocalVisualStudio7GeneratorEscapeForXML(propertyValue); +} + void cmLocalVisualStudio7Generator::OutputDeploymentDebuggerTool( std::ostream& fout, std::string const& config, cmGeneratorTarget* target) { if (this->WindowsCEProject) { - if (const char* dir = target->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY")) { - /* clang-format off */ - fout << - "\t\t\t<DeploymentTool\n" - "\t\t\t\tForceDirty=\"-1\"\n" - "\t\t\t\tRemoteDirectory=\"" << this->EscapeForXML(dir) << "\"\n" - "\t\t\t\tRegisterOutput=\"0\"\n" - "\t\t\t\tAdditionalFiles=\"\"/>\n" - ; - /* clang-format on */ + const char* dir = target->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY"); + const char* additionalFiles = + target->GetProperty("DEPLOYMENT_ADDITIONAL_FILES"); + + if (dir == nullptr && additionalFiles == nullptr) { + return; + } + + fout << "\t\t\t<DeploymentTool\n" + "\t\t\t\tForceDirty=\"-1\"\n" + "\t\t\t\tRemoteDirectory=\"" + << GetEscapedPropertyIfValueNotNULL(dir) + << "\"\n" + "\t\t\t\tRegisterOutput=\"0\"\n" + "\t\t\t\tAdditionalFiles=\"" + << GetEscapedPropertyIfValueNotNULL(additionalFiles) << "\"/>\n"; + + if (dir != nullptr) { std::string const exe = dir + std::string("\\") + target->GetFullName(config); - /* clang-format off */ - fout << - "\t\t\t<DebuggerTool\n" - "\t\t\t\tRemoteExecutable=\"" << this->EscapeForXML(exe) << "\"\n" - "\t\t\t\tArguments=\"\"\n" - "\t\t\t/>\n" - ; - /* clang-format on */ + + fout << "\t\t\t<DebuggerTool\n" + "\t\t\t\tRemoteExecutable=\"" + << this->EscapeForXML(exe) + << "\"\n" + "\t\t\t\tArguments=\"\"\n" + "\t\t\t/>\n"; } } } |