| 2263 | |
| 2264 | template <typename ValueType> |
| 2265 | void cmTargetInternals::AddDirectoryToFileSet(cmTarget* self, |
| 2266 | std::string const& fileSetName, |
| 2267 | ValueType value, |
| 2268 | cm::string_view fileSetType, |
| 2269 | cm::string_view description, |
| 2270 | FileSetType::Action action) |
| 2271 | { |
| 2272 | auto* fileSet = self->GetFileSet(fileSetName); |
| 2273 | if (!fileSet) { |
| 2274 | this->Makefile->IssueMessage( |
| 2275 | MessageType::FATAL_ERROR, |
| 2276 | cmStrCat(description, "has not yet been created.")); |
| 2277 | return; |
| 2278 | } |
| 2279 | if (fileSet->GetType() != fileSetType) { |
| 2280 | this->Makefile->IssueMessage(MessageType::FATAL_ERROR, |
| 2281 | cmStrCat("File set \"", fileSetName, |
| 2282 | "\" is not of type \"", fileSetType, |
| 2283 | "\".")); |
| 2284 | return; |
| 2285 | } |
| 2286 | if (action == FileSetType::Action::Set) { |
| 2287 | fileSet->ClearDirectoryEntries(); |
| 2288 | } |
| 2289 | if (cmNonempty(value)) { |
| 2290 | fileSet->AddDirectoryEntry( |
| 2291 | BT<std::string>(value, this->Makefile->GetBacktrace())); |
| 2292 | } |
| 2293 | } |
| 2294 | |
| 2295 | template <typename ValueType> |
| 2296 | void cmTargetInternals::AddPathToFileSet(cmTarget* self, |
no test coverage detected