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

Method SetImportLinkProperty

Source/cmExportFileGenerator.cxx:603–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601
602template <typename T>
603void 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
637template void cmExportFileGenerator::SetImportLinkProperty<std::string>(
638 std::string const&, cmGeneratorTarget const*, std::string const&,

Callers 1

Calls 4

AddTargetNamespaceMethod · 0.95
cmStrCatFunction · 0.70
emptyMethod · 0.45
GetLocalGeneratorMethod · 0.45

Tested by

no test coverage detected