| 674 | } |
| 675 | |
| 676 | void cmPackageInfoReader::SetImportProperty(cmMakefile* makefile, |
| 677 | cmTarget* target, |
| 678 | cm::string_view property, |
| 679 | cm::string_view configuration, |
| 680 | Json::Value const& object, |
| 681 | std::string const& attribute) const |
| 682 | { |
| 683 | Json::Value const& value = object[attribute]; |
| 684 | if (!value.isNull()) { |
| 685 | std::string fullprop; |
| 686 | if (configuration.empty()) { |
| 687 | fullprop = cmStrCat("IMPORTED_"_s, property); |
| 688 | } else { |
| 689 | fullprop = cmStrCat("IMPORTED_"_s, property, '_', |
| 690 | cmSystemTools::UpperCase(configuration)); |
| 691 | } |
| 692 | |
| 693 | if (value.isString()) { |
| 694 | target->SetProperty(fullprop, this->ResolvePath(value.asString())); |
| 695 | } else { |
| 696 | makefile->IssueMessage(MessageType::WARNING, |
| 697 | cmStrCat("Failed to set property \""_s, property, |
| 698 | "\" on target \""_s, target->GetName(), |
| 699 | "\": attribute \"", attribute, |
| 700 | "\" is not a string."_s)); |
| 701 | } |
| 702 | } |
| 703 | } |
| 704 | |
| 705 | void cmPackageInfoReader::SetMetaProperty( |
| 706 | cmMakefile* makefile, cmTarget* target, std::string const& property, |
no test coverage detected