| 708 | } |
| 709 | |
| 710 | CodemodelConfig::DumpedTargets CodemodelConfig::DumpTargets() |
| 711 | { |
| 712 | DumpedTargets dumpedTargets; |
| 713 | |
| 714 | std::vector<cmGeneratorTarget*> targetList; |
| 715 | cmGlobalGenerator* gg = |
| 716 | this->FileAPI.GetCMakeInstance()->GetGlobalGenerator(); |
| 717 | for (auto const& lg : gg->GetLocalGenerators()) { |
| 718 | cm::append(targetList, lg->GetGeneratorTargets()); |
| 719 | cm::append(targetList, lg->GetOwnedImportedGeneratorTargets()); |
| 720 | } |
| 721 | std::sort(targetList.begin(), targetList.end(), |
| 722 | [](cmGeneratorTarget* l, cmGeneratorTarget* r) { |
| 723 | return l->GetName() < r->GetName(); |
| 724 | }); |
| 725 | |
| 726 | for (cmGeneratorTarget* gt : targetList) { |
| 727 | if (gt->GetType() == cmStateEnums::GLOBAL_TARGET) { |
| 728 | continue; |
| 729 | } |
| 730 | |
| 731 | // Ignore targets starting with `__cmake_` as they are internal. |
| 732 | if (cmHasLiteralPrefix(gt->GetName(), "__cmake_")) { |
| 733 | continue; |
| 734 | } |
| 735 | |
| 736 | Json::Value& targets = gt->IsInBuildSystem() |
| 737 | ? dumpedTargets.BuildSystemTargets |
| 738 | : dumpedTargets.AbstractTargets; |
| 739 | targets.append(this->DumpTarget(gt, targets.size())); |
| 740 | } |
| 741 | |
| 742 | return dumpedTargets; |
| 743 | } |
| 744 | |
| 745 | Json::Value CodemodelConfig::DumpTarget(cmGeneratorTarget* gt, |
| 746 | Json::ArrayIndex ti) |
no test coverage detected