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

Method OutputTopLevelProject

Source/cmGlobalGhsMultiGenerator.cxx:432–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432void cmGlobalGhsMultiGenerator::OutputTopLevelProject(
433 cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators)
434{
435 std::string fname;
436
437 if (generators.empty()) {
438 return;
439 }
440
441 // Collect all targets under this root generator and the transitive
442 // closure of their dependencies.
443 TargetDependSet const projectTargets =
444 this->GetTargetsForProject(root, generators);
445 OrderedTargetDependSet sortedProjectTargets(projectTargets, "");
446 this->ProjectTargets.clear();
447 for (cmGeneratorTarget const* t : sortedProjectTargets) {
448 /* save list of all targets in sorted order */
449 this->ProjectTargets.push_back(t);
450 }
451
452 /* Name top-level projects as filename.top.gpj to avoid name clashes
453 * with target projects. This avoid the issue where the project has
454 * the same name as the executable target.
455 */
456 fname = cmStrCat(root->GetCurrentBinaryDirectory(), '/',
457 root->GetProjectName(), ".top", FILE_EXTENSION);
458
459 cmGeneratedFileStream top(fname);
460 top.SetCopyIfDifferent(true);
461 this->WriteTopLevelProject(top, root);
462 this->WriteTargets(root);
463 this->WriteSubProjects(top, true);
464 this->WriteSubProjects(top, false);
465 top.Close();
466}
467
468std::vector<cmGlobalGenerator::GeneratedMakeCommand>
469cmGlobalGhsMultiGenerator::GenerateBuildCommand(

Callers 1

GenerateMethod · 0.95

Calls 11

WriteTopLevelProjectMethod · 0.95
WriteTargetsMethod · 0.95
WriteSubProjectsMethod · 0.95
GetTargetsForProjectMethod · 0.80
push_backMethod · 0.80
SetCopyIfDifferentMethod · 0.80
CloseMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
clearMethod · 0.45
GetProjectNameMethod · 0.45

Tested by

no test coverage detected