MCPcopy Create free account
hub / github.com/Kitware/CMake / CreateSourceProjectFile

Method CreateSourceProjectFile

Source/cmExtraEclipseCDT4Generator.cxx:202–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void cmExtraEclipseCDT4Generator::CreateSourceProjectFile()
203{
204 assert(this->HomeDirectory != this->HomeOutputDirectory);
205
206 // set up the project name: <project>-Source@<baseSourcePathName>
207 auto const& lg = this->GlobalGenerator->GetLocalGenerators()[0];
208 std::string name = cmExtraEclipseCDT4Generator::GenerateProjectName(
209 lg->GetProjectName(), "Source",
210 cmExtraEclipseCDT4Generator::GetPathBasename(this->HomeDirectory));
211
212 std::string const filename = this->HomeDirectory + "/.project";
213 cmGeneratedFileStream fout(filename);
214 if (!fout) {
215 return;
216 }
217
218 cmXMLWriter xml(fout);
219 xml.StartDocument("UTF-8");
220 xml.StartElement("projectDescription");
221 xml.Element("name", name);
222 xml.Element("comment", "");
223 xml.Element("projects", "");
224 xml.Element("buildSpec", "");
225 xml.Element("natures", "");
226 xml.StartElement("linkedResources");
227
228 if (this->SupportsVirtualFolders) {
229 this->CreateLinksToSubprojects(xml, this->HomeDirectory);
230 this->SrcLinkedResources.clear();
231 }
232
233 xml.EndElement(); // linkedResources
234 xml.EndElement(); // projectDescription
235 xml.EndDocument();
236}
237
238void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
239 char const* envVar,

Callers 1

GenerateMethod · 0.95

Calls 8

StartDocumentMethod · 0.80
EndDocumentMethod · 0.80
GetProjectNameMethod · 0.45
StartElementMethod · 0.45
ElementMethod · 0.45
clearMethod · 0.45
EndElementMethod · 0.45

Tested by

no test coverage detected