[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1483-g1ef1045

Stephen Kelly steveire at gmail.com
Tue Jan 8 12:59:17 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  1ef104503e647998c0f2a8365f430cc0160db235 (commit)
       via  9cfe4f1b769597bd9ba179eba46572a9df27f64c (commit)
       via  97758f29206a172524edd144e588558bb4a83700 (commit)
      from  2d80aa8046360f25da5652d139a98495101617be (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ef104503e647998c0f2a8365f430cc0160db235
commit 1ef104503e647998c0f2a8365f430cc0160db235
Merge: 2d80aa8 9cfe4f1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jan 8 12:59:15 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 8 12:59:15 2013 -0500

    Merge topic 'tll-IMPORTED-targets' into next
    
    9cfe4f1 Allow target_link_libraries with IMPORTED targets.
    97758f2 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9cfe4f1b769597bd9ba179eba46572a9df27f64c
commit 9cfe4f1b769597bd9ba179eba46572a9df27f64c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 26 12:30:00 2012 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jan 8 18:58:18 2013 +0100

    Allow target_link_libraries with IMPORTED targets.
    
    This makes it possible to use:
    
     target_link_libraries(foo LINK_INTERFACE_LIBRARIES bar)
    
    where foo is an IMPORTED target. Other tll() signatures are not
    allowed.

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)
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 60b36fc..e586c28 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -29,6 +29,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 add_library(depA SHARED depA.cpp)
 generate_export_header(depA)
 
+add_library(importedlib UNKNOWN IMPORTED)
+target_link_libraries(importedlib LINK_INTERFACE_LIBRARIES depA)
+
 add_library(depB SHARED depB.cpp)
 generate_export_header(depB)
 

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeVersion.cmake                          |    2 +-
 Source/cmTargetLinkLibrariesCommand.cxx            |   14 ++++++++++++++
 .../target_link_libraries/CMakeLists.txt           |    3 +++
 3 files changed, 18 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list