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

Method SetProperty

Source/cmTarget.cxx:2086–2194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2084}
2085
2086void cmTarget::SetProperty(std::string const& prop, cmValue value)
2087{
2088 if (!IsSettableProperty(this->impl->Makefile, this, prop)) {
2089 return;
2090 }
2091
2092 UsageRequirementProperty* usageRequirements[] = {
2093 &this->impl->IncludeDirectories,
2094 &this->impl->CompileOptions,
2095 &this->impl->CompileFeatures,
2096 &this->impl->CompileDefinitions,
2097 &this->impl->PrecompileHeaders,
2098 &this->impl->Sources,
2099 &this->impl->LinkOptions,
2100 &this->impl->LinkDirectories,
2101 &this->impl->LinkLibraries,
2102 &this->impl->InterfaceLinkLibraries,
2103 &this->impl->InterfaceLinkLibrariesDirect,
2104 &this->impl->InterfaceLinkLibrariesDirectExclude,
2105 &this->impl->ImportedCxxModulesIncludeDirectories,
2106 &this->impl->ImportedCxxModulesCompileDefinitions,
2107 &this->impl->ImportedCxxModulesCompileFeatures,
2108 &this->impl->ImportedCxxModulesCompileOptions,
2109 &this->impl->ImportedCxxModulesLinkLibraries,
2110 };
2111
2112 for (auto* usageRequirement : usageRequirements) {
2113 if (usageRequirement->Write(this->impl.get(), {}, prop, value,
2114 UsageRequirementProperty::Action::Set)) {
2115 return;
2116 }
2117 }
2118
2119 FileSetType* fileSetTypes[] = {
2120 &this->impl->HeadersFileSets,
2121 &this->impl->CxxModulesFileSets,
2122 };
2123
2124 for (auto* fileSetType : fileSetTypes) {
2125 if (fileSetType->WriteProperties(this, this->impl.get(), prop, value,
2126 FileSetType::Action::Set)) {
2127 return;
2128 }
2129 }
2130
2131 if (prop == propIMPORTED_GLOBAL) {
2132 if (!value.IsOn()) {
2133 std::ostringstream e;
2134 e << "IMPORTED_GLOBAL property can't be set to FALSE on targets (\""
2135 << this->impl->Name << "\")\n";
2136 this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
2137 return;
2138 }
2139 /* no need to change anything if value does not change */
2140 if (!this->IsImportedGloballyVisible()) {
2141 this->impl->TargetVisibility = Visibility::ImportedGlobally;
2142 this->GetGlobalGenerator()->IndexTarget(this);
2143 }

Callers 2

cmTargetMethod · 0.95

Calls 15

GetGlobalGeneratorMethod · 0.95
GetTypeMethod · 0.95
IsSettablePropertyFunction · 0.85
cmHasLiteralPrefixFunction · 0.85
WritePropertiesMethod · 0.80
strMethod · 0.80
IndexTargetMethod · 0.80
CheckImportedLibNameMethod · 0.80
eraseMethod · 0.80
cmStrCatFunction · 0.70
WriteMethod · 0.45

Tested by

no test coverage detected