| 601 | |
| 602 | template <typename T> |
| 603 | void cmExportFileGenerator::SetImportLinkProperty( |
| 604 | std::string const& suffix, cmGeneratorTarget const* target, |
| 605 | std::string const& propName, std::vector<T> const& entries, |
| 606 | ImportPropertyMap& properties, ImportLinkPropertyTargetNames targetNames) |
| 607 | { |
| 608 | // Skip the property if there are no entries. |
| 609 | if (entries.empty()) { |
| 610 | return; |
| 611 | } |
| 612 | |
| 613 | cmLocalGenerator const* lg = target->GetLocalGenerator(); |
| 614 | |
| 615 | // Construct the property value. |
| 616 | std::string link_entries; |
| 617 | char const* sep = ""; |
| 618 | for (T const& l : entries) { |
| 619 | // Separate this from the previous entry. |
| 620 | link_entries += sep; |
| 621 | sep = ";"; |
| 622 | |
| 623 | if (targetNames == ImportLinkPropertyTargetNames::Yes) { |
| 624 | std::string temp = asString(l); |
| 625 | this->AddTargetNamespace(temp, target, lg); |
| 626 | link_entries += temp; |
| 627 | } else { |
| 628 | link_entries += asString(l); |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | // Store the property. |
| 633 | std::string prop = cmStrCat(propName, suffix); |
| 634 | properties[prop] = link_entries; |
| 635 | } |
| 636 | |
| 637 | template void cmExportFileGenerator::SetImportLinkProperty<std::string>( |
| 638 | std::string const&, cmGeneratorTarget const*, std::string const&, |
no test coverage detected