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

Method CreateNewProjectFile

Source/cmExtraCodeLiteGenerator.cxx:242–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void cmExtraCodeLiteGenerator::CreateNewProjectFile(
243 std::vector<cmLocalGenerator*> const& lgs, std::string const& filename)
244{
245 cmMakefile const* mf = lgs[0]->GetMakefile();
246 cmGeneratedFileStream fout(filename);
247 if (!fout) {
248 return;
249 }
250 cmXMLWriter xml(fout);
251
252 ////////////////////////////////////
253 xml.StartDocument("utf-8");
254 xml.StartElement("CodeLite_Project");
255 xml.Attribute("Name", lgs[0]->GetProjectName());
256 xml.Attribute("InternalType", "");
257
258 std::string projectType;
259
260 // Collect all used source files in the project
261 // Sort them into two containers, one for C/C++ implementation files
262 // which may have an accompanying header, one for all other files
263 std::map<std::string, cmSourceFile*> cFiles;
264 std::set<std::string> otherFiles;
265
266 for (cmLocalGenerator* lg : lgs) {
267 cmMakefile* makefile = lg->GetMakefile();
268 for (auto const& target : lg->GetGeneratorTargets()) {
269 projectType =
270 this->CollectSourceFiles(makefile, target.get(), cFiles, otherFiles);
271 }
272 }
273
274 // Get the project path ( we need it later to convert files to
275 // their relative path)
276 std::string projectPath = cmSystemTools::GetFilenamePath(filename);
277
278 this->CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf,
279 projectType, "");
280
281 xml.EndElement(); // CodeLite_Project
282}
283
284void cmExtraCodeLiteGenerator::FindMatchingHeaderfiles(
285 std::map<std::string, cmSourceFile*>& cFiles,

Callers 2

CreateProjectFileMethod · 0.95

Calls 11

CollectSourceFilesMethod · 0.95
StartDocumentMethod · 0.80
AttributeMethod · 0.80
GetMakefileMethod · 0.45
StartElementMethod · 0.45
GetProjectNameMethod · 0.45
getMethod · 0.45
EndElementMethod · 0.45
GetNameMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected