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

Method SetImportProperty

Source/cmPackageInfoReader.cxx:676–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676void 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
705void cmPackageInfoReader::SetMetaProperty(
706 cmMakefile* makefile, cmTarget* target, std::string const& property,

Callers 1

SetTargetPropertiesMethod · 0.95

Calls 9

ResolvePathMethod · 0.95
isNullMethod · 0.80
isStringMethod · 0.80
asStringMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
SetPropertyMethod · 0.45
IssueMessageMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected