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

Method GetImportInfo

Source/cmGeneratorTarget.cxx:4742–4778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4740}
4741
4742cmGeneratorTarget::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
4780void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
4781 ImportInfo& info) const

Callers 8

MaybeGetLocationMethod · 0.95
GetSONameMethod · 0.95
GetImportedLibNameMethod · 0.95
GetManagedTypeMethod · 0.95

Calls 7

IsImportedMethod · 0.95
ComputeImportInfoMethod · 0.95
GetTypeMethod · 0.95
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected