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

Method GenerateFileSetProperties

Source/cmExportInstallPackageInfoGenerator.cxx:266–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266bool 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}

Callers 2

GenerateMainFileMethod · 0.95

Calls 11

GetFileSetDirectoryMethod · 0.95
appendMethod · 0.80
GenerateCxxModulesMethod · 0.80
cmStrCatFunction · 0.70
GetFileSetMethod · 0.45
IssueMessageMethod · 0.45
GetNameMethod · 0.45
GetTypeMethod · 0.45
insertMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected