diff options
author | Brad King <brad.king@kitware.com> | 2013-01-10 15:22:26 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-01-10 15:22:26 (GMT) |
commit | 2341470673294badb4eb4447f6878cef21f01b81 (patch) | |
tree | 1849e26d92145dbca1f884a36a5a9047fc670e33 /Source | |
parent | 42d9df9f4f5b06de0f75859cc40750c9b8eec9a1 (diff) | |
parent | 9cfe4f1b769597bd9ba179eba46572a9df27f64c (diff) | |
download | CMake-2341470673294badb4eb4447f6878cef21f01b81.zip CMake-2341470673294badb4eb4447f6878cef21f01b81.tar.gz CMake-2341470673294badb4eb4447f6878cef21f01b81.tar.bz2 |
Merge topic 'tll-IMPORTED-targets'
9cfe4f1 Allow target_link_libraries with IMPORTED targets.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTargetLinkLibrariesCommand.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index f42b0f6..0705fb4 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -35,6 +35,10 @@ bool cmTargetLinkLibrariesCommand ->GetGlobalGenerator()->FindTarget(0, args[0].c_str()); if(!this->Target) { + this->Target = this->Makefile->FindTargetToUse(args[0].c_str()); + } + if(!this->Target) + { cmake::MessageType t = cmake::FATAL_ERROR; // fail by default cmOStringStream e; e << "Cannot specify link libraries for target \"" << args[0] << "\" " @@ -257,6 +261,16 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, // Handle normal case first. if(this->CurrentProcessingState != ProcessingLinkInterface) { + if (this->Target->IsImported()) + { + cmOStringStream e; + e << "Imported targets may only be used with the " + "LINK_INTERFACE_LIBRARIES specifier to target_link_libraries."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + return; + } + + this->Makefile ->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt); if (this->CurrentProcessingState != ProcessingPublicInterface) |