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

Method HandleMissingTarget

Source/cmExportBuildFileGenerator.cxx:134–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void cmExportBuildFileGenerator::HandleMissingTarget(
135 std::string& link_libs, cmGeneratorTarget const* depender,
136 cmGeneratorTarget* dependee)
137{
138 // The target is not in the export.
139 if (!this->AppendMode) {
140 auto const& exportInfo = this->FindExportInfo(dependee);
141
142 if (exportInfo.Namespaces.size() == 1 && exportInfo.Sets.size() == 1) {
143 std::string missingTarget = *exportInfo.Namespaces.begin();
144
145 missingTarget += dependee->GetExportName();
146 link_libs += missingTarget;
147 this->MissingTargets.emplace_back(std::move(missingTarget));
148 return;
149 }
150 // We are not appending, so all exported targets should be
151 // known here. This is probably user-error.
152 this->ComplainAboutMissingTarget(depender, dependee, exportInfo);
153 }
154 // Assume the target will be exported by another command.
155 // Append it with the export namespace.
156 link_libs += this->Namespace;
157 link_libs += dependee->GetExportName();
158}
159
160void cmExportBuildFileGenerator::GetTargets(
161 std::vector<TargetExport>& targets) const

Callers 2

AddTargetNamespaceMethod · 0.45
HandleArgumentsMethod · 0.45

Calls 7

FindExportInfoMethod · 0.95
moveFunction · 0.85
GetExportNameMethod · 0.80
emplace_backMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected