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

Method GenerateImportTargetsConfig

Source/cmExportInstallPackageInfoGenerator.cxx:139–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void cmExportInstallPackageInfoGenerator::GenerateImportTargetsConfig(
140 std::ostream& os, std::string const& config, std::string const& suffix)
141{
142 Json::Value root;
143 root["name"] = this->GetPackageName();
144 root["configuration"] = (config.empty() ? "noconfig" : config);
145
146 std::string const& packagePath = this->GenerateImportPrefix();
147
148 Json::Value& components = root["components"];
149
150 for (auto const& te : this->GetExportSet()->GetTargetExports()) {
151 // Collect import properties for this target.
152 ImportPropertyMap properties;
153 std::set<std::string> importedLocations;
154
155 if (this->GetExportTargetType(te.get()) !=
156 cmStateEnums::INTERFACE_LIBRARY) {
157 this->PopulateImportProperties(config, suffix, te.get(), properties,
158 importedLocations);
159 }
160
161 Json::Value component =
162 this->GenerateInterfaceConfigProperties(suffix, properties);
163 this->GenerateFileSetProperties(component, te->Target, te.get(),
164 packagePath, config);
165
166 if (!component.empty()) {
167 components[te->Target->GetExportName()] = std::move(component);
168 }
169 }
170
171 this->WritePackageInfo(root, os);
172}
173
174std::string cmExportInstallPackageInfoGenerator::GenerateImportPrefix() const
175{

Callers

nothing calls this directly

Calls 12

GenerateImportPrefixMethod · 0.95
moveFunction · 0.85
GetPackageNameMethod · 0.80
GetExportNameMethod · 0.80
WritePackageInfoMethod · 0.80
emptyMethod · 0.45
GetExportSetMethod · 0.45
GetExportTargetTypeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected