diff options
author | Alex Neundorf <neundorf@kde.org> | 2012-09-15 19:55:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-28 13:21:42 (GMT) |
commit | 87f4c01910754199bcdcbc9d564de13d36ba2502 (patch) | |
tree | 82542c001615b1b8fb32d82ce28cd6358affa9ae /Source/cmExportBuildFileGenerator.cxx | |
parent | 999061a4c2000213e6f04695f1f1fe546c86703d (diff) | |
download | CMake-87f4c01910754199bcdcbc9d564de13d36ba2502.zip CMake-87f4c01910754199bcdcbc9d564de13d36ba2502.tar.gz CMake-87f4c01910754199bcdcbc9d564de13d36ba2502.tar.bz2 |
exports: accept a missing target if it is exported exactly once
If a target is exported, and a library it depends on is not part
of the same export set, before this patch cmake errored out.
With this patch, it now checks whether the missing target
is exported somewhere else exactly once, and accepts in this
case (because then it can determine the namespace for the
missing target and use this).
Alex
Diffstat (limited to 'Source/cmExportBuildFileGenerator.cxx')
-rw-r--r-- | Source/cmExportBuildFileGenerator.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 32595ee..fd5a432 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -135,7 +135,8 @@ cmExportBuildFileGenerator void cmExportBuildFileGenerator ::ComplainAboutMissingTarget(cmTarget* depender, - cmTarget* dependee) + cmTarget* dependee, + int occurrences) { if(!this->ExportCommand || !this->ExportCommand->ErrorMessage.empty()) { @@ -143,10 +144,20 @@ cmExportBuildFileGenerator } cmOStringStream e; - e << "called with target \"" << depender->GetName() - << "\" which requires target \"" << dependee->GetName() - << "\" that is not in the export list.\n" - << "If the required target is not easy to reference in this call, " - << "consider using the APPEND option with multiple separate calls."; + if (occurrences == 0) + { + e << "called with target \"" << depender->GetName() + << "\" which requires target \"" << dependee->GetName() + << "\" that is not in the export list.\n" + << "If the required target is not easy to reference in this call, " + << "consider using the APPEND option with multiple separate calls."; + } + else + { + e << "called with target \"" << depender->GetName() + << "\" which requires target \"" << dependee->GetName() + << "\" that is exported " << occurrences << " times in other " + << "export ""lists.\n"; + } this->ExportCommand->ErrorMessage = e.str(); } |