[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3994-g79686ef

Brad King brad.king at kitware.com
Mon Aug 26 11:38:44 EDT 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  79686ef6fd11bf4b0bfab30e7b28469946075641 (commit)
       via  cc8f79670e6c6533a76b80656c87342c0c1696a4 (commit)
       via  fd4fb9ef040dde7961500e2241b43909a9e6b1a4 (commit)
      from  7ad46cbd4ecf7a5125dab8272f7b8605db38ab5c (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=79686ef6fd11bf4b0bfab30e7b28469946075641
commit 79686ef6fd11bf4b0bfab30e7b28469946075641
Merge: 7ad46cb cc8f796
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 26 11:38:41 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 26 11:38:41 2013 -0400

    Merge topic 'find-IMPORTED-targets-for-try_compile' into next
    
    cc8f796 try_compile: Extract IMPORTED targets from INTERFACE_LINK_LIBRARIES
    fd4fb9e try_compile: Extract IMPORTED targets from LINK_DEPENDENT_LIBRARIES


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cc8f79670e6c6533a76b80656c87342c0c1696a4
commit cc8f79670e6c6533a76b80656c87342c0c1696a4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 21 08:55:30 2013 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 26 11:37:00 2013 -0400

    try_compile: Extract IMPORTED targets from INTERFACE_LINK_LIBRARIES

diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 0a17232..819ac37 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -94,7 +94,8 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget* target,
     properties[i->first] = i->second.GetValue();
 
     if(i->first.find("IMPORTED_LINK_INTERFACE_LIBRARIES") == 0
-        || i->first.find("IMPORTED_LINK_DEPENDENT_LIBRARIES") == 0)
+        || i->first.find("IMPORTED_LINK_DEPENDENT_LIBRARIES") == 0
+        || i->first.find("INTERFACE_LINK_LIBRARIES") == 0)
       {
       const std::string libs = i->second.GetValue();
 
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index fb2ca86..1f23b2a 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -227,6 +227,21 @@ install(FILES
     DESTINATION include/testSharedLibRequiredUser
 )
 
+cmake_policy(SET CMP0022 NEW)
+add_library(testSharedLibRequiredUser2 SHARED testSharedLibRequiredUser2.cpp)
+generate_export_header(testSharedLibRequiredUser2)
+set_property(TARGET testSharedLibRequiredUser2 APPEND PROPERTY
+  INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
+)
+set_property(TARGET testSharedLibRequiredUser2 PROPERTY LINK_LIBRARIES testSharedLibRequired)
+set_property(TARGET testSharedLibRequiredUser2 PROPERTY INTERFACE_LINK_LIBRARIES testSharedLibRequired)
+install(FILES
+  "${CMAKE_CURRENT_SOURCE_DIR}/testSharedLibRequiredUser2.h"
+  "${CMAKE_CURRENT_BINARY_DIR}/testsharedlibrequireduser2_export.h"
+    DESTINATION include/testSharedLibRequiredUser2
+)
+cmake_policy(SET CMP0022 OLD)
+
 add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp)
 set_property(TARGET testSharedLibDepends APPEND PROPERTY
   INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}"
@@ -298,6 +313,7 @@ install(TARGETS
           testLibIncludeRequired6
           testSharedLibRequired
           testSharedLibRequiredUser
+          testSharedLibRequiredUser2
           noIncludesInterface
         EXPORT RequiredExp DESTINATION lib
         INCLUDES DESTINATION
@@ -398,7 +414,8 @@ add_subdirectory(sublib) # For CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE test.
 # Export from build tree.
 export(TARGETS testExe1 testLib1 testLib2 testLib3
   testExe2libImp testLib3Imp testLib3ImpDep subdirlib
-  testSharedLibRequired testSharedLibRequiredUser testSharedLibDepends renamed_on_export
+  testSharedLibRequired testSharedLibRequiredUser testSharedLibRequiredUser2
+  testSharedLibDepends renamed_on_export
   cmp0022NEW cmp0022OLD
   NAMESPACE bld_
   FILE ExportBuildTree.cmake
diff --git a/Tests/ExportImport/Export/testSharedLibRequiredUser2.cpp b/Tests/ExportImport/Export/testSharedLibRequiredUser2.cpp
new file mode 100644
index 0000000..d671bf0
--- /dev/null
+++ b/Tests/ExportImport/Export/testSharedLibRequiredUser2.cpp
@@ -0,0 +1,8 @@
+
+#include "testSharedLibRequiredUser2.h"
+
+TestSharedLibRequired TestSharedLibRequiredUser2::foo()
+{
+  TestSharedLibRequired req;
+  return req;
+}
diff --git a/Tests/ExportImport/Export/testSharedLibRequiredUser2.h b/Tests/ExportImport/Export/testSharedLibRequiredUser2.h
new file mode 100644
index 0000000..a132940
--- /dev/null
+++ b/Tests/ExportImport/Export/testSharedLibRequiredUser2.h
@@ -0,0 +1,14 @@
+
+#ifndef TESTSHAREDLIBREQUIREDUSER2_H
+#define TESTSHAREDLIBREQUIREDUSER2_H
+
+#include "testsharedlibrequireduser2_export.h"
+
+#include "testSharedLibRequired.h"
+
+struct TESTSHAREDLIBREQUIREDUSER2_EXPORT TestSharedLibRequiredUser2
+{
+  TestSharedLibRequired foo();
+};
+
+#endif
diff --git a/Tests/ExportImport/Import/try_compile/CMakeLists.txt b/Tests/ExportImport/Import/try_compile/CMakeLists.txt
index 0e57c17..1088461 100644
--- a/Tests/ExportImport/Import/try_compile/CMakeLists.txt
+++ b/Tests/ExportImport/Import/try_compile/CMakeLists.txt
@@ -19,3 +19,18 @@ int main(int argc, char **argv)
 if(NOT SHARED_LIB_DEPENDS)
   message(SEND_ERROR "try_compile with IMPORTED targets failed!\n\n${OUTPUT}")
 endif()
+
+set(CMAKE_REQUIRED_LIBRARIES Req::testSharedLibRequiredUser2)
+check_cxx_source_compiles(
+  "
+#include \"testSharedLibRequiredUser2.h\"
+int main(int argc, char **argv)
+{
+  TestSharedLibRequiredUser2 user;
+  return user.foo().foo();
+}
+" SHARED_LIB_DEPENDS2)
+
+if(NOT SHARED_LIB_DEPENDS2)
+  message(SEND_ERROR "try_compile with IMPORTED targets failed!\n\n${OUTPUT}")
+endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd4fb9ef040dde7961500e2241b43909a9e6b1a4
commit fd4fb9ef040dde7961500e2241b43909a9e6b1a4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Aug 19 11:57:13 2013 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 26 11:36:57 2013 -0400

    try_compile: Extract IMPORTED targets from LINK_DEPENDENT_LIBRARIES

diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index e7b185a..0a17232 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -93,7 +93,8 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget* target,
     {
     properties[i->first] = i->second.GetValue();
 
-    if(i->first.find("IMPORTED_LINK_INTERFACE_LIBRARIES") == 0)
+    if(i->first.find("IMPORTED_LINK_INTERFACE_LIBRARIES") == 0
+        || i->first.find("IMPORTED_LINK_DEPENDENT_LIBRARIES") == 0)
       {
       const std::string libs = i->second.GetValue();
 
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index b5b2027..fb2ca86 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -213,6 +213,19 @@ set_property(TARGET testSharedLibRequired APPEND PROPERTY
     $<$<CXX_COMPILER_ID:GNU>:-DCUSTOM_COMPILE_OPTION>
 )
 
+add_library(testSharedLibRequiredUser SHARED testSharedLibRequiredUser.cpp)
+generate_export_header(testSharedLibRequiredUser)
+# LINK_PRIVATE so that it appears in the LINK_DEPENDENT_LIBRARIES, but not
+# the INTERFACE_LINK_LIBRARIES.
+set_property(TARGET testSharedLibRequiredUser APPEND PROPERTY
+  INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
+)
+target_link_libraries(testSharedLibRequiredUser LINK_PRIVATE testSharedLibRequired)
+install(FILES
+  "${CMAKE_CURRENT_SOURCE_DIR}/testSharedLibRequiredUser.h"
+  "${CMAKE_CURRENT_BINARY_DIR}/testsharedlibrequireduser_export.h"
+    DESTINATION include/testSharedLibRequiredUser
+)
 
 add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp)
 set_property(TARGET testSharedLibDepends APPEND PROPERTY
@@ -284,6 +297,7 @@ install(TARGETS
           testLibIncludeRequired5
           testLibIncludeRequired6
           testSharedLibRequired
+          testSharedLibRequiredUser
           noIncludesInterface
         EXPORT RequiredExp DESTINATION lib
         INCLUDES DESTINATION
@@ -384,7 +398,7 @@ add_subdirectory(sublib) # For CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE test.
 # Export from build tree.
 export(TARGETS testExe1 testLib1 testLib2 testLib3
   testExe2libImp testLib3Imp testLib3ImpDep subdirlib
-  testSharedLibRequired testSharedLibDepends renamed_on_export
+  testSharedLibRequired testSharedLibRequiredUser testSharedLibDepends renamed_on_export
   cmp0022NEW cmp0022OLD
   NAMESPACE bld_
   FILE ExportBuildTree.cmake
diff --git a/Tests/ExportImport/Export/testSharedLibRequiredUser.cpp b/Tests/ExportImport/Export/testSharedLibRequiredUser.cpp
new file mode 100644
index 0000000..5580005
--- /dev/null
+++ b/Tests/ExportImport/Export/testSharedLibRequiredUser.cpp
@@ -0,0 +1,10 @@
+
+#include "testSharedLibRequiredUser.h"
+
+#include "testSharedLibRequired.h"
+
+int TestSharedLibRequiredUser::foo()
+{
+  TestSharedLibRequired req;
+  return req.foo();
+}
diff --git a/Tests/ExportImport/Export/testSharedLibRequiredUser.h b/Tests/ExportImport/Export/testSharedLibRequiredUser.h
new file mode 100644
index 0000000..58bcaa5
--- /dev/null
+++ b/Tests/ExportImport/Export/testSharedLibRequiredUser.h
@@ -0,0 +1,12 @@
+
+#ifndef TESTSHAREDLIBREQUIREDUSER_H
+#define TESTSHAREDLIBREQUIREDUSER_H
+
+#include "testsharedlibrequireduser_export.h"
+
+struct TESTSHAREDLIBREQUIREDUSER_EXPORT TestSharedLibRequiredUser
+{
+  int foo();
+};
+
+#endif
diff --git a/Tests/ExportImport/Import/try_compile/CMakeLists.txt b/Tests/ExportImport/Import/try_compile/CMakeLists.txt
index 5600dff..0e57c17 100644
--- a/Tests/ExportImport/Import/try_compile/CMakeLists.txt
+++ b/Tests/ExportImport/Import/try_compile/CMakeLists.txt
@@ -5,17 +5,17 @@ find_package(testLibRequired 2.5 REQUIRED)
 
 include(CheckCXXSourceCompiles)
 
-set(CMAKE_REQUIRED_LIBRARIES Req::testSharedLibRequired)
+set(CMAKE_REQUIRED_LIBRARIES Req::testSharedLibRequiredUser)
 check_cxx_source_compiles(
   "
-#include \"testSharedLibRequired.h\"
+#include \"testSharedLibRequiredUser.h\"
 int main(int argc, char **argv)
 {
-  TestSharedLibRequired req;
-  return req.foo();
+  TestSharedLibRequiredUser user;
+  return user.foo();
 }
-" SHARED_LIB_REQUIRED)
+" SHARED_LIB_DEPENDS)
 
-if(NOT SHARED_LIB_REQUIRED)
+if(NOT SHARED_LIB_DEPENDS)
   message(SEND_ERROR "try_compile with IMPORTED targets failed!\n\n${OUTPUT}")
 endif()

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list