| 4740 | } |
| 4741 | |
| 4742 | cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo( |
| 4743 | std::string const& config) const |
| 4744 | { |
| 4745 | // There is no imported information for non-imported targets. |
| 4746 | if (!this->IsImported()) { |
| 4747 | return nullptr; |
| 4748 | } |
| 4749 | |
| 4750 | // Lookup/compute/cache the import information for this |
| 4751 | // configuration. |
| 4752 | std::string config_upper; |
| 4753 | if (!config.empty()) { |
| 4754 | config_upper = cmSystemTools::UpperCase(config); |
| 4755 | } else { |
| 4756 | config_upper = "NOCONFIG"; |
| 4757 | } |
| 4758 | |
| 4759 | auto i = this->ImportInfoMap.find(config_upper); |
| 4760 | if (i == this->ImportInfoMap.end()) { |
| 4761 | ImportInfo info; |
| 4762 | this->ComputeImportInfo(config_upper, info); |
| 4763 | ImportInfoMapType::value_type entry(config_upper, info); |
| 4764 | i = this->ImportInfoMap.insert(entry).first; |
| 4765 | } |
| 4766 | |
| 4767 | if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { |
| 4768 | return &i->second; |
| 4769 | } |
| 4770 | // If the location is empty then the target is not available for |
| 4771 | // this configuration. |
| 4772 | if (i->second.Location.empty() && i->second.ImportLibrary.empty()) { |
| 4773 | return nullptr; |
| 4774 | } |
| 4775 | |
| 4776 | // Return the import information. |
| 4777 | return &i->second; |
| 4778 | } |
| 4779 | |
| 4780 | void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, |
| 4781 | ImportInfo& info) const |
no test coverage detected