VS: extended OutputDeploymentDebuggerTool for AdditionalFiles

The `OutputDeploymentDebuggerTool` function now also retrieves a target
property that is used for setting the `AdditionalFiles` attribute of
`DeploymentTool`.
This commit is contained in:
Frank Goyens
2018-06-29 15:41:41 +02:00
committed by Brad King
parent 2f4075fa45
commit b771b2c300

View File

@@ -1245,30 +1245,44 @@ static std::string cmLocalVisualStudio7GeneratorEscapeForXML(
return ret; return ret;
} }
static std::string GetEscapedPropertyIfValueNotNULL(const char* propertyValue)
{
return propertyValue == nullptr
? std::string()
: cmLocalVisualStudio7GeneratorEscapeForXML(propertyValue);
}
void cmLocalVisualStudio7Generator::OutputDeploymentDebuggerTool( void cmLocalVisualStudio7Generator::OutputDeploymentDebuggerTool(
std::ostream& fout, std::string const& config, cmGeneratorTarget* target) std::ostream& fout, std::string const& config, cmGeneratorTarget* target)
{ {
if (this->WindowsCEProject) { if (this->WindowsCEProject) {
if (const char* dir = target->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY")) { const char* dir = target->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY");
/* clang-format off */ const char* additionalFiles =
fout << target->GetProperty("DEPLOYMENT_ADDITIONAL_FILES");
"\t\t\t<DeploymentTool\n"
"\t\t\t\tForceDirty=\"-1\"\n" if (dir == nullptr && additionalFiles == nullptr) {
"\t\t\t\tRemoteDirectory=\"" << this->EscapeForXML(dir) << "\"\n" return;
"\t\t\t\tRegisterOutput=\"0\"\n" }
"\t\t\t\tAdditionalFiles=\"\"/>\n"
; fout << "\t\t\t<DeploymentTool\n"
/* clang-format on */ "\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 = std::string const exe =
dir + std::string("\\") + target->GetFullName(config); dir + std::string("\\") + target->GetFullName(config);
/* clang-format off */
fout << fout << "\t\t\t<DebuggerTool\n"
"\t\t\t<DebuggerTool\n" "\t\t\t\tRemoteExecutable=\""
"\t\t\t\tRemoteExecutable=\"" << this->EscapeForXML(exe) << "\"\n" << this->EscapeForXML(exe)
"\t\t\t\tArguments=\"\"\n" << "\"\n"
"\t\t\t/>\n" "\t\t\t\tArguments=\"\"\n"
; "\t\t\t/>\n";
/* clang-format on */
} }
} }
} }