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

Method ImportTargetConfigurations

Source/cmPackageInfoReader.cxx:946–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

944}
945
946bool cmPackageInfoReader::ImportTargetConfigurations(
947 cmMakefile* makefile, cmExecutionStatus& status) const
948{
949 std::string const& configuration = ToString(this->Data["configuration"]);
950
951 if (configuration.empty()) {
952 makefile->IssueMessage(MessageType::WARNING,
953 cmStrCat("supplemental file "_s, this->Path,
954 " does not specify a configuration"_s));
955 return true;
956 }
957
958 std::string const& package = this->GetName();
959 Json::Value const& components = this->Data["components"];
960
961 for (auto ci = components.begin(), ce = components.end(); ci != ce; ++ci) {
962 // Get component name and look up target.
963 cm::string_view const name = IterKey(ci);
964 auto const& ti = this->ComponentTargets.find(std::string{ name });
965 if (ti == this->ComponentTargets.end()) {
966 status.SetError(cmStrCat("component "_s, name, " was not found"_s));
967 return false;
968 }
969
970 // Read supplemental data for component.
971 this->SetTargetProperties(makefile, ti->second, *ci, package,
972 configuration);
973 }
974
975 return true;
976}

Callers 1

ImportPackageTargetsMethod · 0.80

Calls 11

GetNameMethod · 0.95
SetTargetPropertiesMethod · 0.95
IterKeyFunction · 0.85
ToStringFunction · 0.70
cmStrCatFunction · 0.70
emptyMethod · 0.45
IssueMessageMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected