cmVisualStudio10TargetGenerator: Remove empty Elem::EndElement()

The method no longer does anything.  Remove it and remove calls to it.
This commit is contained in:
Vitaly Stakhovsky
2018-05-25 10:18:34 -04:00
committed by Brad King
parent 726c090297
commit e7e25c6cb6
+31 -125
View File
@@ -97,7 +97,6 @@ struct cmVisualStudio10TargetGenerator::Elem
} }
this->S << cmVS10EscapeXML(val); this->S << cmVS10EscapeXML(val);
} }
void EndElement() {}
~Elem() ~Elem()
{ {
// Do not emit element which has not been started // Do not emit element which has not been started
@@ -408,14 +407,12 @@ void cmVisualStudio10TargetGenerator::Generate()
// Require Nsight Tegra 1.6 for JCompile support. // Require Nsight Tegra 1.6 for JCompile support.
e1.Element("NsightTegraProjectRevisionNumber", "7"); e1.Element("NsightTegraProjectRevisionNumber", "7");
} }
e1.EndElement();
} }
if (const char* hostArch = if (const char* hostArch =
this->GlobalGenerator->GetPlatformToolsetHostArchitecture()) { this->GlobalGenerator->GetPlatformToolsetHostArchitecture()) {
Elem e1(e0, "PropertyGroup"); Elem e1(e0, "PropertyGroup");
e1.Element("PreferredToolArchitecture", hostArch); e1.Element("PreferredToolArchitecture", hostArch);
e1.EndElement();
} }
if (this->ProjectType != csproj) { if (this->ProjectType != csproj) {
@@ -556,28 +553,23 @@ void cmVisualStudio10TargetGenerator::Generate()
e1.Element("OutputType", outputType); e1.Element("OutputType", outputType);
e1.Element("AppDesignerFolder", "Properties"); e1.Element("AppDesignerFolder", "Properties");
} }
e1.EndElement();
} }
switch (this->ProjectType) { switch (this->ProjectType) {
case vcxproj: case vcxproj:
Elem(e0, "Import") Elem(e0, "Import").Attribute("Project", VS10_CXX_DEFAULT_PROPS);
.Attribute("Project", VS10_CXX_DEFAULT_PROPS)
.EndElement();
break; break;
case csproj: case csproj:
Elem(e0, "Import") Elem(e0, "Import")
.Attribute("Project", VS10_CSharp_DEFAULT_PROPS) .Attribute("Project", VS10_CSharp_DEFAULT_PROPS)
.Attribute("Condition", "Exists('" VS10_CSharp_DEFAULT_PROPS "')") .Attribute("Condition", "Exists('" VS10_CSharp_DEFAULT_PROPS "')");
.EndElement();
break; break;
} }
this->WriteProjectConfigurationValues(e0); this->WriteProjectConfigurationValues(e0);
if (this->ProjectType == vcxproj) { if (this->ProjectType == vcxproj) {
Elem(e0, "Import").Attribute("Project", VS10_CXX_PROPS).EndElement(); Elem(e0, "Import").Attribute("Project", VS10_CXX_PROPS);
} }
{ {
Elem e1(e0, "ImportGroup"); Elem e1(e0, "ImportGroup");
@@ -586,16 +578,15 @@ void cmVisualStudio10TargetGenerator::Generate()
if (this->GlobalGenerator->IsCudaEnabled()) { if (this->GlobalGenerator->IsCudaEnabled()) {
Elem(e1, "Import") Elem(e1, "Import")
.Attribute( .Attribute("Project",
"Project", "$(VCTargetsPath)\\BuildCustomizations\\CUDA " + "$(VCTargetsPath)\\BuildCustomizations\\CUDA " +
this->GlobalGenerator->GetPlatformToolsetCudaString() + ".props") this->GlobalGenerator->GetPlatformToolsetCudaString() +
.EndElement(); ".props");
} }
if (this->GlobalGenerator->IsMasmEnabled()) { if (this->GlobalGenerator->IsMasmEnabled()) {
Elem(e1, "Import") Elem(e1, "Import")
.Attribute("Project", .Attribute("Project",
"$(VCTargetsPath)\\BuildCustomizations\\masm.props") "$(VCTargetsPath)\\BuildCustomizations\\masm.props");
.EndElement();
} }
if (this->GlobalGenerator->IsNasmEnabled()) { if (this->GlobalGenerator->IsNasmEnabled()) {
// Always search in the standard modules location. // Always search in the standard modules location.
@@ -608,9 +599,8 @@ void cmVisualStudio10TargetGenerator::Generate()
ConvertToWindowsSlash(propsLocal); ConvertToWindowsSlash(propsLocal);
this->Makefile->ConfigureFile(propsTemplate.c_str(), this->Makefile->ConfigureFile(propsTemplate.c_str(),
propsLocal.c_str(), false, true, true); propsLocal.c_str(), false, true, true);
Elem(e1, "Import").Attribute("Project", propsLocal).EndElement(); Elem(e1, "Import").Attribute("Project", propsLocal);
} }
e1.EndElement();
} }
{ {
Elem e1(e0, "ImportGroup"); Elem e1(e0, "ImportGroup");
@@ -633,14 +623,12 @@ void cmVisualStudio10TargetGenerator::Generate()
Elem(e1, "Import") Elem(e1, "Import")
.Attribute("Project", props) .Attribute("Project", props)
.Attribute("Condition", "exists('" + props + "')") .Attribute("Condition", "exists('" + props + "')")
.Attribute("Label", "LocalAppDataPlatform") .Attribute("Label", "LocalAppDataPlatform");
.EndElement();
} }
this->WritePlatformExtensions(e1); this->WritePlatformExtensions(e1);
e1.EndElement();
} }
Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros").EndElement(); Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
this->WriteWinRTPackageCertificateKeyFile(e0); this->WriteWinRTPackageCertificateKeyFile(e0);
this->WritePathAndIncrementalLinkOptions(e0); this->WritePathAndIncrementalLinkOptions(e0);
this->WriteItemDefinitionGroups(e0); this->WriteItemDefinitionGroups(e0);
@@ -654,12 +642,10 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteSDKReferences(e0); this->WriteSDKReferences(e0);
switch (this->ProjectType) { switch (this->ProjectType) {
case vcxproj: case vcxproj:
Elem(e0, "Import").Attribute("Project", VS10_CXX_TARGETS).EndElement(); Elem(e0, "Import").Attribute("Project", VS10_CXX_TARGETS);
break; break;
case csproj: case csproj:
Elem(e0, "Import") Elem(e0, "Import").Attribute("Project", VS10_CSharp_TARGETS);
.Attribute("Project", VS10_CSharp_TARGETS)
.EndElement();
break; break;
} }
@@ -674,21 +660,18 @@ void cmVisualStudio10TargetGenerator::Generate()
.Attribute("Project", .Attribute("Project",
"$(VCTargetsPath)\\BuildCustomizations\\CUDA " + "$(VCTargetsPath)\\BuildCustomizations\\CUDA " +
this->GlobalGenerator->GetPlatformToolsetCudaString() + this->GlobalGenerator->GetPlatformToolsetCudaString() +
".targets") ".targets");
.EndElement();
} }
if (this->GlobalGenerator->IsMasmEnabled()) { if (this->GlobalGenerator->IsMasmEnabled()) {
Elem(e1, "Import") Elem(e1, "Import")
.Attribute("Project", .Attribute("Project",
"$(VCTargetsPath)\\BuildCustomizations\\masm.targets") "$(VCTargetsPath)\\BuildCustomizations\\masm.targets");
.EndElement();
} }
if (this->GlobalGenerator->IsNasmEnabled()) { if (this->GlobalGenerator->IsNasmEnabled()) {
std::string nasmTargets = std::string nasmTargets =
GetCMakeFilePath("Templates/MSBuild/nasm.targets"); GetCMakeFilePath("Templates/MSBuild/nasm.targets");
Elem(e1, "Import").Attribute("Project", nasmTargets).EndElement(); Elem(e1, "Import").Attribute("Project", nasmTargets);
} }
e1.EndElement();
} }
if (this->ProjectType == csproj) { if (this->ProjectType == csproj) {
for (std::string const& c : this->Configurations) { for (std::string const& c : this->Configurations) {
@@ -696,7 +679,6 @@ void cmVisualStudio10TargetGenerator::Generate()
e1.Attribute("Condition", "'$(Configuration)' == '" + c + "'"); e1.Attribute("Condition", "'$(Configuration)' == '" + c + "'");
e1.SetHasElements(); e1.SetHasElements();
this->WriteEvents(e1, c); this->WriteEvents(e1, c);
e1.EndElement();
} }
// make sure custom commands are executed before build (if necessary) // make sure custom commands are executed before build (if necessary)
{ {
@@ -709,10 +691,8 @@ void cmVisualStudio10TargetGenerator::Generate()
oss << " " oss << " "
<< "$(BuildDependsOn)\n"; << "$(BuildDependsOn)\n";
e1.Element("BuildDependsOn", oss.str()); e1.Element("BuildDependsOn", oss.str());
e1.EndElement();
} }
} }
e0.EndElement();
} }
if (BuildFileStream.Close()) { if (BuildFileStream.Close()) {
@@ -768,7 +748,6 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0)
this->WriteDotNetReference(e1, i.first, i.second, h.first); this->WriteDotNetReference(e1, i.first, i.second, h.first);
} }
} }
e1.EndElement();
} }
} }
@@ -798,7 +777,6 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference(
e2.Element("HintPath", hint); e2.Element("HintPath", hint);
} }
this->WriteDotNetReferenceCustomTags(e2, ref); this->WriteDotNetReferenceCustomTags(e2, ref);
e2.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags( void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags(
@@ -921,10 +899,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0)
} }
} }
} }
e2.EndElement();
} }
e1.EndElement();
} }
} }
@@ -965,9 +940,7 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup(Elem& e0)
} }
} }
e2.Element("SubType", "Designer"); e2.Element("SubType", "Designer");
e2.EndElement();
} }
e1.EndElement();
} }
} }
@@ -980,8 +953,7 @@ void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences(Elem& e0)
.Attribute("Project", .Attribute("Project",
"$(MSBuildExtensionsPath)\\Microsoft\\WindowsPhone\\v" "$(MSBuildExtensionsPath)\\Microsoft\\WindowsPhone\\v"
"$(TargetPlatformVersion)\\Microsoft.Cpp.WindowsPhone." "$(TargetPlatformVersion)\\Microsoft.Cpp.WindowsPhone."
"$(TargetPlatformVersion).targets") "$(TargetPlatformVersion).targets");
.EndElement();
} }
} }
} }
@@ -1004,8 +976,7 @@ void cmVisualStudio10TargetGenerator::WriteTargetsFileReferences(Elem& e1)
Elem(e1, "Import") Elem(e1, "Import")
.Attribute("Project", tac.File) .Attribute("Project", tac.File)
.Attribute("Condition", oss.str()) .Attribute("Condition", oss.str());
.EndElement();
} }
} }
@@ -1028,9 +999,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTReferences(Elem& e0)
Elem e2(e1, "Reference"); Elem e2(e1, "Reference");
e2.Attribute("Include", ri); e2.Attribute("Include", ri);
e2.Element("IsWinMDFile", "true"); e2.Element("IsWinMDFile", "true");
e2.EndElement();
} }
e1.EndElement();
} }
} }
@@ -1045,9 +1014,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations(Elem& e0)
e2.Attribute("Include", c + "|" + this->Platform); e2.Attribute("Include", c + "|" + this->Platform);
e2.Element("Configuration", c); e2.Element("Configuration", c);
e2.Element("Platform", this->Platform); e2.Element("Platform", this->Platform);
e2.EndElement();
} }
e1.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
@@ -1107,8 +1074,6 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
} else if (this->NsightTegra) { } else if (this->NsightTegra) {
this->WriteNsightTegraConfigurationValues(e1, c); this->WriteNsightTegraConfigurationValues(e1, c);
} }
e1.EndElement();
} }
} }
@@ -1308,8 +1273,6 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
if (!link.empty()) { if (!link.empty()) {
e2.Element("Link", link); e2.Element("Link", link);
} }
e2.EndElement();
e1.EndElement();
} }
for (std::string const& c : this->Configurations) { for (std::string const& c : this->Configurations) {
cmCustomCommandGenerator ccg(command, c, lg); cmCustomCommandGenerator ccg(command, c, lg);
@@ -1345,10 +1308,6 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
comment); comment);
} }
} }
if (this->ProjectType != csproj) {
spe2->EndElement();
spe1->EndElement();
}
} }
void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp( void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp(
@@ -1381,10 +1340,9 @@ void cmVisualStudio10TargetGenerator::WriteCustomRuleCSharp(
e1.S << "\n Inputs=\"" << cmVS10EscapeAttr(inputs) << "\""; e1.S << "\n Inputs=\"" << cmVS10EscapeAttr(inputs) << "\"";
e1.S << "\n Outputs=\"" << cmVS10EscapeAttr(outputs) << "\""; e1.S << "\n Outputs=\"" << cmVS10EscapeAttr(outputs) << "\"";
if (!comment.empty()) { if (!comment.empty()) {
Elem(e1, "Exec").Attribute("Command", "echo " + comment).EndElement(); Elem(e1, "Exec").Attribute("Command", "echo " + comment);
} }
Elem(e1, "Exec").Attribute("Command", script).EndElement(); Elem(e1, "Exec").Attribute("Command", script);
e1.EndElement();
} }
std::string cmVisualStudio10TargetGenerator::ConvertPath( std::string cmVisualStudio10TargetGenerator::ConvertPath(
@@ -1465,26 +1423,21 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
Elem e2(e1, "XML"); Elem e2(e1, "XML");
e2.Attribute("Include", oi); e2.Attribute("Include", oi);
e2.Element("Filter", "Resource Files"); e2.Element("Filter", "Resource Files");
e2.EndElement();
} else if (cmSystemTools::GetFilenameExtension(fileName) == } else if (cmSystemTools::GetFilenameExtension(fileName) ==
".appxmanifest") { ".appxmanifest") {
Elem e2(e1, "AppxManifest"); Elem e2(e1, "AppxManifest");
e2.Attribute("Include", oi); e2.Attribute("Include", oi);
e2.Element("Filter", "Resource Files"); e2.Element("Filter", "Resource Files");
e2.EndElement();
} else if (cmSystemTools::GetFilenameExtension(fileName) == ".pfx") { } else if (cmSystemTools::GetFilenameExtension(fileName) == ".pfx") {
Elem e2(e1, "None"); Elem e2(e1, "None");
e2.Attribute("Include", oi); e2.Attribute("Include", oi);
e2.Element("Filter", "Resource Files"); e2.Element("Filter", "Resource Files");
e2.EndElement();
} else { } else {
Elem e2(e1, "Image"); Elem e2(e1, "Image");
e2.Attribute("Include", oi); e2.Attribute("Include", oi);
e2.Element("Filter", "Resource Files"); e2.Element("Filter", "Resource Files");
e2.EndElement();
} }
} }
e1.EndElement();
} }
std::vector<cmSourceFile const*> resxObjs; std::vector<cmSourceFile const*> resxObjs;
@@ -1497,9 +1450,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
Elem e2(e1, "EmbeddedResource"); Elem e2(e1, "EmbeddedResource");
e2.Attribute("Include", obj); e2.Attribute("Include", obj);
e2.Element("Filter", "Resource Files"); e2.Element("Filter", "Resource Files");
e2.EndElement();
} }
e1.EndElement();
} }
{ {
Elem e1(e0, "ItemGroup"); Elem e1(e0, "ItemGroup");
@@ -1518,7 +1469,6 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
Elem e2(e1, "Filter"); Elem e2(e1, "Filter");
e2.Attribute("Include", name); e2.Attribute("Include", name);
e2.Element("UniqueIdentifier", "{" + guid + "}"); e2.Element("UniqueIdentifier", "{" + guid + "}");
e2.EndElement();
} }
} }
@@ -1531,12 +1481,8 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
e2.Element("Extensions", e2.Element("Extensions",
"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;" "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;"
"gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms"); "gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms");
e2.EndElement();
} }
e1.EndElement();
} }
e0.EndElement();
} }
fout << '\n'; fout << '\n';
@@ -1601,9 +1547,7 @@ void cmVisualStudio10TargetGenerator::WriteGroupSources(
if (!filter.empty()) { if (!filter.empty()) {
e2.Element("Filter", filter); e2.Element("Filter", filter);
} }
e2.EndElement();
} }
e1.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteHeaderSource(Elem& e1, void cmVisualStudio10TargetGenerator::WriteHeaderSource(Elem& e1,
@@ -1618,7 +1562,6 @@ void cmVisualStudio10TargetGenerator::WriteHeaderSource(Elem& e1,
std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); std::string xamlFileName = fileName.substr(0, fileName.find_last_of("."));
e2.Element("DependentUpon", xamlFileName); e2.Element("DependentUpon", xamlFileName);
} }
e2.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
@@ -1893,7 +1836,6 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
// write source file specific tags // write source file specific tags
this->WriteCSharpSourceProperties(e2, sourceFileTags); this->WriteCSharpSourceProperties(e2, sourceFileTags);
} }
e2.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2, void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2,
@@ -2049,15 +1991,12 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
if (!exclude_configs.empty()) { if (!exclude_configs.empty()) {
this->WriteExcludeFromBuild(e2, exclude_configs); this->WriteExcludeFromBuild(e2, exclude_configs);
} }
e2.EndElement();
} }
} }
if (this->IsMissingFiles) { if (this->IsMissingFiles) {
this->WriteMissingFiles(e1); this->WriteMissingFiles(e1);
} }
e1.EndElement();
} }
void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
@@ -2360,7 +2299,6 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
this->OutputLinkIncremental(e1, config); this->OutputLinkIncremental(e1, config);
} }
} }
e1.EndElement();
} }
void cmVisualStudio10TargetGenerator::OutputLinkIncremental( void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
@@ -2656,7 +2594,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
if (!clOptions.IsDebug()) { if (!clOptions.IsDebug()) {
Elem e3(e2, "DebugInformationFormat"); Elem e3(e2, "DebugInformationFormat");
e3.SetHasElements(); e3.SetHasElements();
e3.EndElement();
} }
// Specify the compiler program database file if configured. // Specify the compiler program database file if configured.
@@ -2678,8 +2615,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
e2.Element("AdditionalUsingDirectories", dirs); e2.Element("AdditionalUsingDirectories", dirs);
} }
} }
e2.EndElement();
} }
bool cmVisualStudio10TargetGenerator::ComputeRcOptions() bool cmVisualStudio10TargetGenerator::ComputeRcOptions()
@@ -2733,8 +2668,6 @@ void cmVisualStudio10TargetGenerator::WriteRCOptions(
rcOptions.OutputAdditionalIncludeDirectories("RC"); rcOptions.OutputAdditionalIncludeDirectories("RC");
rcOptions.PrependInheritedString("AdditionalOptions"); rcOptions.PrependInheritedString("AdditionalOptions");
rcOptions.OutputFlagMap(); rcOptions.OutputFlagMap();
e2.EndElement();
} }
bool cmVisualStudio10TargetGenerator::ComputeCudaOptions() bool cmVisualStudio10TargetGenerator::ComputeCudaOptions()
@@ -2881,8 +2814,6 @@ void cmVisualStudio10TargetGenerator::WriteCudaOptions(
cudaOptions.OutputPreprocessorDefinitions("CUDA"); cudaOptions.OutputPreprocessorDefinitions("CUDA");
cudaOptions.PrependInheritedString("AdditionalOptions"); cudaOptions.PrependInheritedString("AdditionalOptions");
cudaOptions.OutputFlagMap(); cudaOptions.OutputFlagMap();
e2.EndElement();
} }
bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions() bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions()
@@ -2950,7 +2881,6 @@ void cmVisualStudio10TargetGenerator::WriteCudaLinkOptions(
Elem e2(e1, "CudaLink"); Elem e2(e1, "CudaLink");
OptionsHelper cudaLinkOptions(*(this->CudaLinkOptions[configName]), e2); OptionsHelper cudaLinkOptions(*(this->CudaLinkOptions[configName]), e2);
cudaLinkOptions.OutputFlagMap(); cudaLinkOptions.OutputFlagMap();
e2.EndElement();
} }
bool cmVisualStudio10TargetGenerator::ComputeMasmOptions() bool cmVisualStudio10TargetGenerator::ComputeMasmOptions()
@@ -3006,8 +2936,6 @@ void cmVisualStudio10TargetGenerator::WriteMasmOptions(
masmOptions.OutputAdditionalIncludeDirectories("ASM_MASM"); masmOptions.OutputAdditionalIncludeDirectories("ASM_MASM");
masmOptions.PrependInheritedString("AdditionalOptions"); masmOptions.PrependInheritedString("AdditionalOptions");
masmOptions.OutputFlagMap(); masmOptions.OutputFlagMap();
e2.EndElement();
} }
bool cmVisualStudio10TargetGenerator::ComputeNasmOptions() bool cmVisualStudio10TargetGenerator::ComputeNasmOptions()
@@ -3067,8 +2995,6 @@ void cmVisualStudio10TargetGenerator::WriteNasmOptions(
// Preprocessor definitions and includes are shared with clOptions. // Preprocessor definitions and includes are shared with clOptions.
OptionsHelper clOptions(*(this->ClOptions[configName]), e2); OptionsHelper clOptions(*(this->ClOptions[configName]), e2);
clOptions.OutputPreprocessorDefinitions("ASM_NASM"); clOptions.OutputPreprocessorDefinitions("ASM_NASM");
e2.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteLibOptions( void cmVisualStudio10TargetGenerator::WriteLibOptions(
@@ -3091,7 +3017,6 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions(
OptionsHelper oh(libOptions, e2); OptionsHelper oh(libOptions, e2);
oh.PrependInheritedString("AdditionalOptions"); oh.PrependInheritedString("AdditionalOptions");
oh.OutputFlagMap(); oh.OutputFlagMap();
e2.EndElement();
} }
// We cannot generate metadata for static libraries. WindowsPhone // We cannot generate metadata for static libraries. WindowsPhone
@@ -3101,7 +3026,6 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions(
this->GlobalGenerator->TargetsWindowsStore()) { this->GlobalGenerator->TargetsWindowsStore()) {
Elem e2(e1, "Link"); Elem e2(e1, "Link");
e2.Element("GenerateWindowsMetadata", "false"); e2.Element("GenerateWindowsMetadata", "false");
e2.EndElement();
} }
} }
@@ -3125,7 +3049,6 @@ void cmVisualStudio10TargetGenerator::WriteManifestOptions(
} }
Elem e2(e1, "Manifest"); Elem e2(e1, "Manifest");
e2.Element("AdditionalManifestFiles", oss.str()); e2.Element("AdditionalManifestFiles", oss.str());
e2.EndElement();
} }
} }
@@ -3230,8 +3153,6 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
e2.Element("AdditionalOptions", e2.Element("AdditionalOptions",
std::string(antAdditionalOptions) + " %(AdditionalOptions)"); std::string(antAdditionalOptions) + " %(AdditionalOptions)");
} }
e2.EndElement();
} }
bool cmVisualStudio10TargetGenerator::ComputeLinkOptions() bool cmVisualStudio10TargetGenerator::ComputeLinkOptions()
@@ -3528,14 +3449,12 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(
OptionsHelper linkOptions(*(this->LinkOptions[config]), e2); OptionsHelper linkOptions(*(this->LinkOptions[config]), e2);
linkOptions.PrependInheritedString("AdditionalOptions"); linkOptions.PrependInheritedString("AdditionalOptions");
linkOptions.OutputFlagMap(); linkOptions.OutputFlagMap();
e2.EndElement();
} }
if (!this->GlobalGenerator->NeedLinkLibraryDependencies( if (!this->GlobalGenerator->NeedLinkLibraryDependencies(
this->GeneratorTarget)) { this->GeneratorTarget)) {
Elem e2(e1, "ProjectReference"); Elem e2(e1, "ProjectReference");
e2.Element("LinkLibraryDependencies", "false"); e2.Element("LinkLibraryDependencies", "false");
e2.EndElement();
} }
} }
@@ -3661,7 +3580,6 @@ void cmVisualStudio10TargetGenerator::WriteMidlOptions(
e2.Element("TypeLibraryName", "%(Filename).tlb"); e2.Element("TypeLibraryName", "%(Filename).tlb");
e2.Element("InterfaceIdentifierFileName", "%(Filename)_i.c"); e2.Element("InterfaceIdentifierFileName", "%(Filename)_i.c");
e2.Element("ProxyFileName", "%(Filename)_p.c"); e2.Element("ProxyFileName", "%(Filename)_p.c");
e2.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0) void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0)
@@ -3700,7 +3618,6 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0)
this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) { this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) {
this->WriteAntBuildOptions(e1, c); this->WriteAntBuildOptions(e1, c);
} }
e1.EndElement();
} }
} }
@@ -3754,7 +3671,6 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
Elem e2(e1, name); Elem e2(e1, name);
e2.Element("Message", comment); e2.Element("Message", comment);
e2.Element("Command", script); e2.Element("Command", script);
e2.EndElement();
} else { } else {
std::string strippedComment = comment; std::string strippedComment = comment;
strippedComment.erase( strippedComment.erase(
@@ -3831,9 +3747,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
e2.Element("CopyToOutputDirectory", "Never"); e2.Element("CopyToOutputDirectory", "Never");
} }
} }
e2.EndElement();
} }
e1.EndElement();
} }
void cmVisualStudio10TargetGenerator::WritePlatformExtensions(Elem& e1) void cmVisualStudio10TargetGenerator::WritePlatformExtensions(Elem& e1)
@@ -3870,7 +3784,6 @@ void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension(
Elem e2(e1, "Import"); Elem e2(e1, "Import");
e2.Attribute("Project", s); e2.Attribute("Project", s);
e2.Attribute("Condition", "exists('" + s + "')"); e2.Attribute("Condition", "exists('" + s + "')");
e2.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0) void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0)
@@ -3884,7 +3797,7 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0)
e1.StartElement("ItemGroup"); e1.StartElement("ItemGroup");
hasWrittenItemGroup = true; hasWrittenItemGroup = true;
for (std::string const& ri : sdkReferences) { for (std::string const& ri : sdkReferences) {
Elem(e1, "SDKReference").Attribute("Include", ri).EndElement(); Elem(e1, "SDKReference").Attribute("Include", ri);
} }
} }
@@ -3916,16 +3829,13 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0)
} }
} }
} }
e1.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteSingleSDKReference( void cmVisualStudio10TargetGenerator::WriteSingleSDKReference(
Elem& e1, std::string const& extension, std::string const& version) Elem& e1, std::string const& extension, std::string const& version)
{ {
Elem(e1, "SDKReference") Elem(e1, "SDKReference")
.Attribute("Include", extension + ", Version=" + version) .Attribute("Include", extension + ", Version=" + version);
.EndElement();
} }
void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile( void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile(
@@ -3975,7 +3885,6 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile(
if (!thumb.empty()) { if (!thumb.empty()) {
e1.Element("PackageCertificateThumbprint", thumb); e1.Element("PackageCertificateThumbprint", thumb);
} }
e1.EndElement();
} else if (!pfxFile.empty()) { } else if (!pfxFile.empty()) {
Elem e1(e0, "PropertyGroup"); Elem e1(e0, "PropertyGroup");
e1.Element("PackageCertificateKeyFile", pfxFile); e1.Element("PackageCertificateKeyFile", pfxFile);
@@ -3983,7 +3892,6 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile(
if (!thumb.empty()) { if (!thumb.empty()) {
e1.Element("PackageCertificateThumbprint", thumb); e1.Element("PackageCertificateThumbprint", thumb);
} }
e1.EndElement();
} }
} }
} }
@@ -4223,7 +4131,6 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1)
Elem e2(e1, "Xml"); Elem e2(e1, "Xml");
e2.Attribute("Include", sourceFile); e2.Attribute("Include", sourceFile);
e2.Element("SubType", "Designer"); e2.Element("SubType", "Designer");
e2.EndElement();
} }
this->AddedFiles.push_back(sourceFile); this->AddedFiles.push_back(sourceFile);
@@ -4231,13 +4138,13 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1)
cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png", smallLogo, cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png", smallLogo,
false); false);
ConvertToWindowsSlash(smallLogo); ConvertToWindowsSlash(smallLogo);
Elem(e1, "Image").Attribute("Include", smallLogo).EndElement(); Elem(e1, "Image").Attribute("Include", smallLogo);
this->AddedFiles.push_back(smallLogo); this->AddedFiles.push_back(smallLogo);
std::string logo = this->DefaultArtifactDir + "/Logo.png"; std::string logo = this->DefaultArtifactDir + "/Logo.png";
cmSystemTools::CopyAFile(templateFolder + "/Logo.png", logo, false); cmSystemTools::CopyAFile(templateFolder + "/Logo.png", logo, false);
ConvertToWindowsSlash(logo); ConvertToWindowsSlash(logo);
Elem(e1, "Image").Attribute("Include", logo).EndElement(); Elem(e1, "Image").Attribute("Include", logo);
this->AddedFiles.push_back(logo); this->AddedFiles.push_back(logo);
std::string applicationIcon = std::string applicationIcon =
@@ -4245,7 +4152,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1)
cmSystemTools::CopyAFile(templateFolder + "/ApplicationIcon.png", cmSystemTools::CopyAFile(templateFolder + "/ApplicationIcon.png",
applicationIcon, false); applicationIcon, false);
ConvertToWindowsSlash(applicationIcon); ConvertToWindowsSlash(applicationIcon);
Elem(e1, "Image").Attribute("Include", applicationIcon).EndElement(); Elem(e1, "Image").Attribute("Include", applicationIcon);
this->AddedFiles.push_back(applicationIcon); this->AddedFiles.push_back(applicationIcon);
} }
@@ -4500,7 +4407,6 @@ void cmVisualStudio10TargetGenerator::WriteCommonMissingFiles(
Elem e2(e1, "AppxManifest"); Elem e2(e1, "AppxManifest");
e2.Attribute("Include", sourceFile); e2.Attribute("Include", sourceFile);
e2.Element("SubType", "Designer"); e2.Element("SubType", "Designer");
e2.EndElement();
} }
this->AddedFiles.push_back(sourceFile); this->AddedFiles.push_back(sourceFile);
@@ -4508,34 +4414,34 @@ void cmVisualStudio10TargetGenerator::WriteCommonMissingFiles(
cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png", smallLogo, cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png", smallLogo,
false); false);
ConvertToWindowsSlash(smallLogo); ConvertToWindowsSlash(smallLogo);
Elem(e1, "Image").Attribute("Include", smallLogo).EndElement(); Elem(e1, "Image").Attribute("Include", smallLogo);
this->AddedFiles.push_back(smallLogo); this->AddedFiles.push_back(smallLogo);
std::string smallLogo44 = this->DefaultArtifactDir + "/SmallLogo44x44.png"; std::string smallLogo44 = this->DefaultArtifactDir + "/SmallLogo44x44.png";
cmSystemTools::CopyAFile(templateFolder + "/SmallLogo44x44.png", smallLogo44, cmSystemTools::CopyAFile(templateFolder + "/SmallLogo44x44.png", smallLogo44,
false); false);
ConvertToWindowsSlash(smallLogo44); ConvertToWindowsSlash(smallLogo44);
Elem(e1, "Image").Attribute("Include", smallLogo44).EndElement(); Elem(e1, "Image").Attribute("Include", smallLogo44);
this->AddedFiles.push_back(smallLogo44); this->AddedFiles.push_back(smallLogo44);
std::string logo = this->DefaultArtifactDir + "/Logo.png"; std::string logo = this->DefaultArtifactDir + "/Logo.png";
cmSystemTools::CopyAFile(templateFolder + "/Logo.png", logo, false); cmSystemTools::CopyAFile(templateFolder + "/Logo.png", logo, false);
ConvertToWindowsSlash(logo); ConvertToWindowsSlash(logo);
Elem(e1, "Image").Attribute("Include", logo).EndElement(); Elem(e1, "Image").Attribute("Include", logo);
this->AddedFiles.push_back(logo); this->AddedFiles.push_back(logo);
std::string storeLogo = this->DefaultArtifactDir + "/StoreLogo.png"; std::string storeLogo = this->DefaultArtifactDir + "/StoreLogo.png";
cmSystemTools::CopyAFile(templateFolder + "/StoreLogo.png", storeLogo, cmSystemTools::CopyAFile(templateFolder + "/StoreLogo.png", storeLogo,
false); false);
ConvertToWindowsSlash(storeLogo); ConvertToWindowsSlash(storeLogo);
Elem(e1, "Image").Attribute("Include", storeLogo).EndElement(); Elem(e1, "Image").Attribute("Include", storeLogo);
this->AddedFiles.push_back(storeLogo); this->AddedFiles.push_back(storeLogo);
std::string splashScreen = this->DefaultArtifactDir + "/SplashScreen.png"; std::string splashScreen = this->DefaultArtifactDir + "/SplashScreen.png";
cmSystemTools::CopyAFile(templateFolder + "/SplashScreen.png", splashScreen, cmSystemTools::CopyAFile(templateFolder + "/SplashScreen.png", splashScreen,
false); false);
ConvertToWindowsSlash(splashScreen); ConvertToWindowsSlash(splashScreen);
Elem(e1, "Image").Attribute("Include", splashScreen).EndElement(); Elem(e1, "Image").Attribute("Include", splashScreen);
this->AddedFiles.push_back(splashScreen); this->AddedFiles.push_back(splashScreen);
if (this->AddedDefaultCertificate) { if (this->AddedDefaultCertificate) {
@@ -4543,7 +4449,7 @@ void cmVisualStudio10TargetGenerator::WriteCommonMissingFiles(
std::string keyFile = std::string keyFile =
this->DefaultArtifactDir + "/Windows_TemporaryKey.pfx"; this->DefaultArtifactDir + "/Windows_TemporaryKey.pfx";
ConvertToWindowsSlash(keyFile); ConvertToWindowsSlash(keyFile);
Elem(e1, "None").Attribute("Include", keyFile).EndElement(); Elem(e1, "None").Attribute("Include", keyFile);
} }
} }