summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-02-22 19:32:27 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-02-22 19:32:27 (GMT)
commit7dcf2269ecd88e9d7c97ce8536db7c8ef32b61a4 (patch)
treecb63313c2d8b42b4a66ebb14dde1814b594331ed
parentc5f27110abac57b027b36127173654b572c7c3cb (diff)
parent79e13af195e8664a18449b09d3bc2f0e04c80992 (diff)
downloadCMake-7dcf2269ecd88e9d7c97ce8536db7c8ef32b61a4.zip
CMake-7dcf2269ecd88e9d7c97ce8536db7c8ef32b61a4.tar.gz
CMake-7dcf2269ecd88e9d7c97ce8536db7c8ef32b61a4.tar.bz2
Merge topic 'FixBadXMLInEclipseProjects'
79e13af Add XML escaping for directory name in Eclipse projects (#11658) 8074bca Fix XML escaping for target names in Eclipse project files (#11658) cb94587 Fix XML escaping for the project() name in Eclipse projects (#11658)
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 0ef771f..eb78647 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -431,7 +431,8 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
{
emittedDirs.insert(dir);
fout << "<pathentry include=\""
- << cmExtraEclipseCDT4Generator::GetEclipsePath(dir)
+ << cmExtraEclipseCDT4Generator::EscapeForXML(
+ cmExtraEclipseCDT4Generator::GetEclipsePath(dir))
<< "\" kind=\"inc\" path=\"\" system=\"true\"/>\n";
}
}
@@ -875,8 +876,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
fout << "</cconfiguration>\n"
"</storageModule>\n"
"<storageModule moduleId=\"cdtBuildSystem\" version=\"4.0.0\">\n"
- "<project id=\"" << mf->GetProjectName() << ".null.1\""
- " name=\"" << mf->GetProjectName() << "\"/>\n"
+ "<project id=\"" << this->EscapeForXML(mf->GetProjectName())
+ << ".null.1\" name=\"" << this->EscapeForXML(mf->GetProjectName())
+ << "\"/>\n"
"</storageModule>\n"
"</cproject>\n"
;
@@ -927,7 +929,8 @@ cmExtraEclipseCDT4Generator::GenerateProjectName(const std::string& name,
const std::string& type,
const std::string& path)
{
- return name + (type.empty() ? "" : "-") + type + "@" + path;
+ return cmExtraEclipseCDT4Generator::EscapeForXML(name)
+ +(type.empty() ? "" : "-") + type + "@" + path;
}
std::string cmExtraEclipseCDT4Generator::EscapeForXML(const std::string& value)
@@ -999,15 +1002,17 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
const std::string& path,
const char* prefix)
{
+ std::string targetXml = cmExtraEclipseCDT4Generator::EscapeForXML(target);
+ std::string pathXml = cmExtraEclipseCDT4Generator::EscapeForXML(path);
fout <<
- "<target name=\"" << prefix << target << "\""
- " path=\"" << path.c_str() << "\""
+ "<target name=\"" << prefix << targetXml << "\""
+ " path=\"" << pathXml.c_str() << "\""
" targetID=\"org.eclipse.cdt.make.MakeTargetBuilder\">\n"
"<buildCommand>"
<< cmExtraEclipseCDT4Generator::GetEclipsePath(make)
<< "</buildCommand>\n"
"<buildArguments>" << makeArgs << "</buildArguments>\n"
- "<buildTarget>" << target << "</buildTarget>\n"
+ "<buildTarget>" << targetXml << "</buildTarget>\n"
"<stopOnError>true</stopOnError>\n"
"<useDefaultCommand>false</useDefaultCommand>\n"
"</target>\n"