| 944 | } |
| 945 | |
| 946 | bool 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 | } |
no test coverage detected