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

Function PopulateImportedTarget

Source/cmCxxModuleMetadata.cxx:542–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542void PopulateImportedTarget(cmTarget& target, MetaDataProperties const& props,
543 cmCxxModuleMetadata const& meta,
544 std::vector<std::string> const& configs)
545{
546 if (!props.AllIncludeDirectories.empty()) {
547 target.SetProperty("IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES",
548 cmJoin(props.AllIncludeDirectories, ";"));
549 }
550
551 if (!props.AllCompileDefinitions.empty()) {
552 target.SetProperty("IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS",
553 cmJoin(props.AllCompileDefinitions, ";"));
554 }
555
556 if (!props.AllCompileOptions.empty()) {
557 target.SetProperty("IMPORTED_CXX_MODULES_COMPILE_OPTIONS",
558 cmJoin(props.AllCompileOptions, ";"));
559 }
560
561 if (!props.AllCompileFeatures.empty()) {
562 target.SetProperty("IMPORTED_CXX_MODULES_COMPILE_FEATURES",
563 cmJoin(props.AllCompileFeatures, ";"));
564 }
565
566 for (auto const& config : configs) {
567 std::vector<std::string> moduleList;
568 for (auto const& module : meta.Modules) {
569 if (module.IsInterface) {
570 moduleList.push_back(cmStrCat(module.LogicalName, "="_s,
571 props.NormalizePath(module.SourcePath)));
572 }
573 }
574
575 if (!moduleList.empty()) {
576 std::string upperConfig = cmSystemTools::UpperCase(config);
577 std::string propertyName =
578 cmStrCat("IMPORTED_CXX_MODULES_"_s, upperConfig);
579 target.SetProperty(propertyName, cmJoin(moduleList, ";"));
580 }
581 }
582}
583
584} // namespace
585

Callers 1

PopulateTargetMethod · 0.85

Calls 6

push_backMethod · 0.80
cmJoinFunction · 0.70
cmStrCatFunction · 0.70
emptyMethod · 0.45
SetPropertyMethod · 0.45
NormalizePathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…