| 597 | } |
| 598 | |
| 599 | void cmExportCMakeConfigGenerator::GenerateTargetFileSets( |
| 600 | cmGeneratorTarget* gte, std::ostream& os, cmTargetExport const* te) |
| 601 | { |
| 602 | auto interfaceFileSets = gte->Target->GetAllInterfaceFileSets(); |
| 603 | if (!interfaceFileSets.empty()) { |
| 604 | std::string targetName = cmStrCat(this->Namespace, gte->GetExportName()); |
| 605 | os << "if(NOT CMAKE_VERSION VERSION_LESS \"3.23.0\")\n" |
| 606 | " target_sources(" |
| 607 | << targetName << '\n'; |
| 608 | |
| 609 | for (auto const& name : interfaceFileSets) { |
| 610 | auto* fileSet = gte->Target->GetFileSet(name); |
| 611 | if (!fileSet) { |
| 612 | gte->Makefile->IssueMessage( |
| 613 | MessageType::FATAL_ERROR, |
| 614 | cmStrCat("File set \"", name, |
| 615 | "\" is listed in interface file sets of ", gte->GetName(), |
| 616 | " but has not been created")); |
| 617 | return; |
| 618 | } |
| 619 | |
| 620 | os << " INTERFACE" |
| 621 | << "\n FILE_SET " << cmOutputConverter::EscapeForCMake(name) |
| 622 | << "\n TYPE " |
| 623 | << cmOutputConverter::EscapeForCMake(fileSet->GetType()) |
| 624 | << "\n BASE_DIRS " |
| 625 | << this->GetFileSetDirectories(gte, fileSet, te) << "\n FILES " |
| 626 | << this->GetFileSetFiles(gte, fileSet, te) << '\n'; |
| 627 | } |
| 628 | |
| 629 | os << " )\nelse()\n set_property(TARGET " << targetName |
| 630 | << "\n APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES"; |
| 631 | for (auto const& name : interfaceFileSets) { |
| 632 | auto* fileSet = gte->Target->GetFileSet(name); |
| 633 | if (!fileSet) { |
| 634 | gte->Makefile->IssueMessage( |
| 635 | MessageType::FATAL_ERROR, |
| 636 | cmStrCat("File set \"", name, |
| 637 | "\" is listed in interface file sets of ", gte->GetName(), |
| 638 | " but has not been created")); |
| 639 | return; |
| 640 | } |
| 641 | |
| 642 | if (fileSet->GetType() == "HEADERS"_s) { |
| 643 | os << "\n " << this->GetFileSetDirectories(gte, fileSet, te); |
| 644 | } |
| 645 | } |
| 646 | os << "\n )\nendif()\n\n"; |
| 647 | } |
| 648 | } |
| 649 | |
| 650 | std::string cmExportCMakeConfigGenerator::GetCxxModuleFile( |
| 651 | std::string const& name) const |
no test coverage detected