| 4778 | } |
| 4779 | |
| 4780 | void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, |
| 4781 | ImportInfo& info) const |
| 4782 | { |
| 4783 | // This method finds information about an imported target from its |
| 4784 | // properties. The "IMPORTED_" namespace is reserved for properties |
| 4785 | // defined by the project exporting the target. |
| 4786 | |
| 4787 | // Initialize members. |
| 4788 | info.NoSOName = false; |
| 4789 | |
| 4790 | cmValue loc = nullptr; |
| 4791 | cmValue imp = nullptr; |
| 4792 | std::string suffix; |
| 4793 | if (!this->Target->GetMappedConfig(desired_config, loc, imp, suffix)) { |
| 4794 | return; |
| 4795 | } |
| 4796 | |
| 4797 | // Get the link interface. |
| 4798 | { |
| 4799 | // Use the INTERFACE_LINK_LIBRARIES special representation directly |
| 4800 | // to get backtraces. |
| 4801 | cmBTStringRange entries = this->Target->GetLinkInterfaceEntries(); |
| 4802 | if (!entries.empty()) { |
| 4803 | info.LibrariesProp = "INTERFACE_LINK_LIBRARIES"; |
| 4804 | for (BT<std::string> const& entry : entries) { |
| 4805 | info.Libraries.emplace_back(entry); |
| 4806 | } |
| 4807 | } else if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) { |
| 4808 | std::string linkProp = |
| 4809 | cmStrCat("IMPORTED_LINK_INTERFACE_LIBRARIES", suffix); |
| 4810 | cmValue propertyLibs = this->GetProperty(linkProp); |
| 4811 | if (!propertyLibs) { |
| 4812 | linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES"; |
| 4813 | propertyLibs = this->GetProperty(linkProp); |
| 4814 | } |
| 4815 | if (propertyLibs) { |
| 4816 | info.LibrariesProp = linkProp; |
| 4817 | info.Libraries.emplace_back(*propertyLibs); |
| 4818 | } |
| 4819 | } |
| 4820 | } |
| 4821 | for (BT<std::string> const& entry : |
| 4822 | this->Target->GetLinkInterfaceDirectEntries()) { |
| 4823 | info.LibrariesHeadInclude.emplace_back(entry); |
| 4824 | } |
| 4825 | for (BT<std::string> const& entry : |
| 4826 | this->Target->GetLinkInterfaceDirectExcludeEntries()) { |
| 4827 | info.LibrariesHeadExclude.emplace_back(entry); |
| 4828 | } |
| 4829 | if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { |
| 4830 | if (loc) { |
| 4831 | info.LibName = *loc; |
| 4832 | } |
| 4833 | return; |
| 4834 | } |
| 4835 | |
| 4836 | // A provided configuration has been chosen. Load the |
| 4837 | // configuration's properties. |
no test coverage detected