summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-23 19:03:28 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-23 19:14:47 (GMT)
commit09164c637b02f964152453bdbe1b1591c39c1f7c (patch)
tree5e6f08546008695a48f26ff1a00755ea740d2424 /Source/cmVisualStudio10TargetGenerator.cxx
parent29a0642ba78392ab20037e677d28eae2eea23de7 (diff)
downloadCMake-09164c637b02f964152453bdbe1b1591c39c1f7c.zip
CMake-09164c637b02f964152453bdbe1b1591c39c1f7c.tar.gz
CMake-09164c637b02f964152453bdbe1b1591c39c1f7c.tar.bz2
VS: Encode more content correctly in vcxproj files (#15031)
In cmVisualStudio10TargetGenerator, add missing cmVS10EscapeXML calls around paths to source and object files, custom command dependencies and outputs, and platform name/version values.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2429e59..5674317 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -343,19 +343,20 @@ void cmVisualStudio10TargetGenerator::Generate()
}
this->WriteString("<Platform>", 2);
- (*this->BuildFileStream) << this->Platform << "</Platform>\n";
+ (*this->BuildFileStream) << cmVS10EscapeXML(this->Platform)
+ << "</Platform>\n";
const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");
if(!projLabel)
{
projLabel = this->Name.c_str();
}
this->WriteString("<ProjectName>", 2);
- (*this->BuildFileStream) << projLabel << "</ProjectName>\n";
+ (*this->BuildFileStream) << cmVS10EscapeXML(projLabel) << "</ProjectName>\n";
if(const char* targetFrameworkVersion = this->Target->GetProperty(
"VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
{
this->WriteString("<TargetFrameworkVersion>", 2);
- (*this->BuildFileStream) << targetFrameworkVersion
+ (*this->BuildFileStream) << cmVS10EscapeXML(targetFrameworkVersion)
<< "</TargetFrameworkVersion>\n";
}
this->WriteString("</PropertyGroup>\n", 1);
@@ -507,7 +508,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations()
this->WriteString("<Configuration>", 3);
(*this->BuildFileStream ) << *i << "</Configuration>\n";
this->WriteString("<Platform>", 3);
- (*this->BuildFileStream) << this->Platform << "</Platform>\n";
+ (*this->BuildFileStream) << cmVS10EscapeXML(this->Platform)
+ << "</Platform>\n";
this->WriteString("</ProjectConfiguration>\n", 2);
}
this->WriteString("</ItemGroup>\n", 1);
@@ -700,7 +702,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile const* source,
(*this->BuildFileStream ) << script << "</Command>\n";
this->WritePlatformConfigTag("AdditionalInputs", i->c_str(), 3);
- (*this->BuildFileStream ) << source->GetFullPath();
+ (*this->BuildFileStream ) << cmVS10EscapeXML(source->GetFullPath());
for(std::vector<std::string>::const_iterator d =
ccg.GetDepends().begin();
d != ccg.GetDepends().end();
@@ -710,7 +712,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile const* source,
if(this->LocalGenerator->GetRealDependency(d->c_str(), i->c_str(), dep))
{
this->ConvertToWindowsSlash(dep);
- (*this->BuildFileStream ) << ";" << dep;
+ (*this->BuildFileStream ) << ";" << cmVS10EscapeXML(dep);
}
}
(*this->BuildFileStream ) << ";%(AdditionalInputs)</AdditionalInputs>\n";
@@ -723,7 +725,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile const* source,
{
std::string out = *o;
this->ConvertToWindowsSlash(out);
- (*this->BuildFileStream ) << sep << out;
+ (*this->BuildFileStream ) << sep << cmVS10EscapeXML(out);
sep = ";";
}
(*this->BuildFileStream ) << "</Outputs>\n";
@@ -824,7 +826,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
std::string obj = (*oi)->GetFullPath();
this->WriteString("<EmbeddedResource Include=\"", 2);
this->ConvertToWindowsSlash(obj);
- (*this->BuildFileStream ) << obj << "\">\n";
+ (*this->BuildFileStream ) << cmVS10EscapeXML(obj) << "\">\n";
this->WriteString("<Filter>Resource Files</Filter>\n", 3);
this->WriteString("</EmbeddedResource>\n", 2);
}
@@ -843,7 +845,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
std::string obj = *oi;
this->WriteString("<Object Include=\"", 2);
this->ConvertToWindowsSlash(obj);
- (*this->BuildFileStream ) << obj << "\">\n";
+ (*this->BuildFileStream ) << cmVS10EscapeXML(obj) << "\">\n";
this->WriteString("<Filter>Object Libraries</Filter>\n", 3);
this->WriteString("</Object>\n", 2);
}
@@ -978,7 +980,7 @@ WriteGroupSources(const char* name,
std::string path = this->ConvertPath(source, s->RelativePath);
this->ConvertToWindowsSlash(path);
(*this->BuildFileStream) << name << " Include=\""
- << path;
+ << cmVS10EscapeXML(path);
if(strlen(filter))
{
(*this->BuildFileStream) << "\">\n";
@@ -1033,7 +1035,8 @@ void cmVisualStudio10TargetGenerator::WriteSource(
}
this->ConvertToWindowsSlash(sourceFile);
this->WriteString("<", 2);
- (*this->BuildFileStream ) << tool << " Include=\"" << sourceFile << "\"";
+ (*this->BuildFileStream ) << tool << " Include=\""
+ << cmVS10EscapeXML(sourceFile) << "\"";
if(sf->GetExtension() == "h" &&
this->IsResxHeader(sf->GetFullPath()))
@@ -1165,7 +1168,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
std::string obj = *oi;
this->WriteString("<Object Include=\"", 2);
this->ConvertToWindowsSlash(obj);
- (*this->BuildFileStream ) << obj << "\" />\n";
+ (*this->BuildFileStream ) << cmVS10EscapeXML(obj) << "\" />\n";
}
this->WriteString("</ItemGroup>\n", 1);
@@ -2044,7 +2047,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
path += dt->GetName();
path += ".vcxproj";
}
- (*this->BuildFileStream) << path << "\">\n";
+ (*this->BuildFileStream) << cmVS10EscapeXML(path) << "\">\n";
this->WriteString("<Project>", 3);
(*this->BuildFileStream)
<< this->GlobalGenerator->GetGUID(name.c_str())