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

Method ComplainAboutMissingTarget

Source/cmExportBuildFileGenerator.cxx:208–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208void cmExportBuildFileGenerator::ComplainAboutMissingTarget(
209 cmGeneratorTarget const* depender, cmGeneratorTarget const* dependee,
210 ExportInfo const& exportInfo) const
211{
212 std::ostringstream e;
213 e << "export called with target \"" << depender->GetName()
214 << "\" which requires target \"" << dependee->GetName() << "\" ";
215 if (exportInfo.Sets.empty()) {
216 e << "that is not in any export set.";
217 } else {
218 if (exportInfo.Sets.size() == 1) {
219 e << "that is not in this export set, but in another export set which "
220 "is "
221 "exported multiple times with different namespaces: ";
222 } else {
223 e << "that is not in this export set, but in multiple other export "
224 "sets: ";
225 }
226 e << cmJoin(exportInfo.Files, ", ") << ".\n"
227 << "An exported target cannot depend upon another target which is "
228 "exported in more than one export set or with more than one "
229 "namespace. Consider consolidating the exports of the \""
230 << dependee->GetName() << "\" target to a single export.";
231 }
232
233 this->ReportError(e.str());
234}
235
236void cmExportBuildFileGenerator::ComplainAboutDuplicateTarget(
237 std::string const& targetName) const

Callers 1

HandleMissingTargetMethod · 0.95

Calls 6

strMethod · 0.80
cmJoinFunction · 0.70
GetNameMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
ReportErrorMethod · 0.45

Tested by

no test coverage detected