summaryrefslogtreecommitdiff
path: root/Source/cmExportBuildFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-30 17:25:52 -0500
committerBrad King <brad.king@kitware.com>2008-01-30 17:25:52 -0500
commit7902bc06aae07a9d4cde81ab41c3c86694d80a9b (patch)
tree20810436488a804ffadb37c349d8db594d368a36 /Source/cmExportBuildFileGenerator.cxx
parent22be36f8d52fae0f509725253f175b0c1ec65dcc (diff)
downloadcmake-7902bc06aae07a9d4cde81ab41c3c86694d80a9b.tar.gz
ENH: Implemented link-interface specification feature.
- Shared libs and executables with exports may now have explicit transitive link dependencies specified - Created LINK_INTERFACE_LIBRARIES and related properties - Exported targets get the interface libraries as their IMPORTED_LINK_LIBRARIES property. - The export() and install(EXPORT) commands now give an error when a linked target is not included since the user can change the interface libraries instead of adding the target.
Diffstat (limited to 'Source/cmExportBuildFileGenerator.cxx')
-rw-r--r--Source/cmExportBuildFileGenerator.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index f0dca0acb4..618cd19de0 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -16,6 +16,14 @@
=========================================================================*/
#include "cmExportBuildFileGenerator.h"
+#include "cmExportCommand.h"
+
+//----------------------------------------------------------------------------
+cmExportBuildFileGenerator::cmExportBuildFileGenerator()
+{
+ this->ExportCommand = 0;
+}
+
//----------------------------------------------------------------------------
bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
{
@@ -116,9 +124,19 @@ void
cmExportBuildFileGenerator
::ComplainAboutMissingTarget(cmTarget* target, const char* dep)
{
+ if(!this->ExportCommand || !this->ExportCommand->ErrorMessage.empty())
+ {
+ return;
+ }
+
cmOStringStream e;
- e << "WARNING: EXPORT(...) includes target " << target->GetName()
- << " which links to target \"" << dep
- << "\" that is not in the export set.";
- cmSystemTools::Message(e.str().c_str());
+ e << "called with target \"" << target->GetName()
+ << "\" which links to target \"" << dep
+ << "\" that is not in the export list.\n"
+ << "If the link dependency is not part of the public interface "
+ << "consider setting the LINK_INTERFACE_LIBRARIES property on \""
+ << target->GetName() << "\". Otherwise add it to the export list. "
+ << "If the link dependency is not easy to reference in this call, "
+ << "consider using the APPEND option with multiple separate calls.";
+ this->ExportCommand->ErrorMessage = e.str();
}