| 264 | } |
| 265 | |
| 266 | bool cmExportInstallPackageInfoGenerator::GenerateFileSetProperties( |
| 267 | Json::Value& component, cmGeneratorTarget* gte, cmTargetExport const* te, |
| 268 | std::string const& packagePath, cm::optional<std::string> config) |
| 269 | { |
| 270 | bool hasModules = false; |
| 271 | std::set<std::string> seenIncludeDirectories; |
| 272 | for (auto const& name : gte->Target->GetAllInterfaceFileSets()) { |
| 273 | cmFileSet* fileSet = gte->Target->GetFileSet(name); |
| 274 | |
| 275 | if (!fileSet) { |
| 276 | gte->Makefile->IssueMessage( |
| 277 | MessageType::FATAL_ERROR, |
| 278 | cmStrCat("File set \"", name, |
| 279 | "\" is listed in interface file sets of ", gte->GetName(), |
| 280 | " but has not been created")); |
| 281 | return false; |
| 282 | } |
| 283 | |
| 284 | cm::optional<std::string> const& fileSetDirectory = |
| 285 | this->GetFileSetDirectory(gte, te, fileSet, config); |
| 286 | |
| 287 | if (fileSet->GetType() == "HEADERS"_s) { |
| 288 | if (fileSetDirectory && |
| 289 | !cm::contains(seenIncludeDirectories, *fileSetDirectory)) { |
| 290 | component["includes"].append(*fileSetDirectory); |
| 291 | seenIncludeDirectories.insert(*fileSetDirectory); |
| 292 | } |
| 293 | } else if (fileSet->GetType() == "CXX_MODULES"_s) { |
| 294 | hasModules = true; |
| 295 | this->RequiresConfigFiles = true; |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | if (hasModules && config) { |
| 300 | std::string const manifestPath = |
| 301 | this->GenerateCxxModules(component, gte, packagePath, *config); |
| 302 | if (!manifestPath.empty()) { |
| 303 | this->ConfigCxxModuleFiles[*config] = |
| 304 | cmStrCat(this->FileDir, '/', manifestPath); |
| 305 | } |
| 306 | } |
| 307 | return true; |
| 308 | } |
no test coverage detected