diff options
author | Brad King <brad.king@kitware.com> | 2018-07-10 14:06:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-07-10 14:06:07 (GMT) |
commit | 5f7886c52b8f06c6429c66c102af9f4afe72896c (patch) | |
tree | ba8e32fb23b8948d10b9ea39fe48f809c32fccef /Source | |
parent | be69317b971dd381fe771701aa9ed944416e26c6 (diff) | |
parent | 3b2ea092ef42f52434c9618023d3a7216bb43c98 (diff) | |
download | CMake-5f7886c52b8f06c6429c66c102af9f4afe72896c.zip CMake-5f7886c52b8f06c6429c66c102af9f4afe72896c.tar.gz CMake-5f7886c52b8f06c6429c66c102af9f4afe72896c.tar.bz2 |
Merge topic 'vs-deployment-files'
3b2ea092ef Help: Add documentation for DEPLOYMENT_ADDITIONAL_FILES
b771b2c300 VS: extended OutputDeploymentDebuggerTool for AdditionalFiles
2f4075fa45 VS: moved EscapeForXML function higher up and made static
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2184
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 73 |
1 files changed, 44 insertions, 29 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 4b0b66d..c90c5b8 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1233,30 +1233,56 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( } } +static std::string cmLocalVisualStudio7GeneratorEscapeForXML( + const std::string& s) +{ + std::string ret = s; + cmSystemTools::ReplaceString(ret, "&", "&"); + cmSystemTools::ReplaceString(ret, "\"", """); + cmSystemTools::ReplaceString(ret, "<", "<"); + cmSystemTools::ReplaceString(ret, ">", ">"); + cmSystemTools::ReplaceString(ret, "\n", "
"); + 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"; } } } @@ -2056,17 +2082,6 @@ void cmLocalVisualStudio7Generator::WriteVCProjFooter( << "</VisualStudioProject>\n"; } -std::string cmLocalVisualStudio7GeneratorEscapeForXML(const std::string& s) -{ - std::string ret = s; - cmSystemTools::ReplaceString(ret, "&", "&"); - cmSystemTools::ReplaceString(ret, "\"", """); - cmSystemTools::ReplaceString(ret, "<", "<"); - cmSystemTools::ReplaceString(ret, ">", ">"); - cmSystemTools::ReplaceString(ret, "\n", "
"); - return ret; -} - std::string cmLocalVisualStudio7Generator::EscapeForXML(const std::string& s) { return cmLocalVisualStudio7GeneratorEscapeForXML(s); |