| 2194 | } |
| 2195 | |
| 2196 | void cmTarget::AppendProperty(std::string const& prop, |
| 2197 | std::string const& value, |
| 2198 | cm::optional<cmListFileBacktrace> const& bt, |
| 2199 | bool asString) |
| 2200 | { |
| 2201 | if (!IsSettableProperty(this->impl->Makefile, this, prop)) { |
| 2202 | return; |
| 2203 | } |
| 2204 | if (prop == "IMPORTED_GLOBAL") { |
| 2205 | this->impl->Makefile->IssueMessage( |
| 2206 | MessageType::FATAL_ERROR, |
| 2207 | cmStrCat("IMPORTED_GLOBAL property can't be appended, only set on " |
| 2208 | "imported targets (\"", |
| 2209 | this->impl->Name, "\")\n")); |
| 2210 | } |
| 2211 | |
| 2212 | UsageRequirementProperty* usageRequirements[] = { |
| 2213 | &this->impl->IncludeDirectories, |
| 2214 | &this->impl->CompileOptions, |
| 2215 | &this->impl->CompileFeatures, |
| 2216 | &this->impl->CompileDefinitions, |
| 2217 | &this->impl->PrecompileHeaders, |
| 2218 | &this->impl->Sources, |
| 2219 | &this->impl->LinkOptions, |
| 2220 | &this->impl->LinkDirectories, |
| 2221 | &this->impl->LinkLibraries, |
| 2222 | &this->impl->InterfaceLinkLibraries, |
| 2223 | &this->impl->InterfaceLinkLibrariesDirect, |
| 2224 | &this->impl->InterfaceLinkLibrariesDirectExclude, |
| 2225 | &this->impl->ImportedCxxModulesIncludeDirectories, |
| 2226 | &this->impl->ImportedCxxModulesCompileDefinitions, |
| 2227 | &this->impl->ImportedCxxModulesCompileFeatures, |
| 2228 | &this->impl->ImportedCxxModulesCompileOptions, |
| 2229 | &this->impl->ImportedCxxModulesLinkLibraries, |
| 2230 | }; |
| 2231 | |
| 2232 | for (auto* usageRequirement : usageRequirements) { |
| 2233 | if (usageRequirement->Write(this->impl.get(), bt, prop, cmValue(value), |
| 2234 | UsageRequirementProperty::Action::Append)) { |
| 2235 | return; |
| 2236 | } |
| 2237 | } |
| 2238 | |
| 2239 | FileSetType* fileSetTypes[] = { |
| 2240 | &this->impl->HeadersFileSets, |
| 2241 | &this->impl->CxxModulesFileSets, |
| 2242 | }; |
| 2243 | |
| 2244 | for (auto* fileSetType : fileSetTypes) { |
| 2245 | if (fileSetType->WriteProperties(this, this->impl.get(), prop, value, |
| 2246 | FileSetType::Action::Append)) { |
| 2247 | return; |
| 2248 | } |
| 2249 | } |
| 2250 | |
| 2251 | if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME")) { |
| 2252 | this->impl->Makefile->IssueMessage( |
| 2253 | MessageType::FATAL_ERROR, prop + " property may not be APPENDed."); |
no test coverage detected