[Cmake-commits] CMake branch, next, updated. v2.8.7-2160-gf0f1c4a

Clinton Stimpson clinton at elemtech.com
Fri Jan 20 00:03:26 EST 2012


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  f0f1c4a7e0b1a8838407c090c58ca8e13e2ff62f (commit)
       via  0d96decdd069451c9b805e411abe0fc6225c8ee9 (commit)
      from  9d9a838b2e83b29953f787ca1b0148e38874287a (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=f0f1c4a7e0b1a8838407c090c58ca8e13e2ff62f
commit f0f1c4a7e0b1a8838407c090c58ca8e13e2ff62f
Merge: 9d9a838 0d96dec
Author:     Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Fri Jan 20 00:03:24 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 20 00:03:24 2012 -0500

    Merge topic 'GetPrerequisites-rpath-OSX' into next
    
    0d96dec GetPrerequisites: Add test for @rpath support.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d96decdd069451c9b805e411abe0fc6225c8ee9
commit 0d96decdd069451c9b805e411abe0fc6225c8ee9
Author:     Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Thu Jan 19 22:03:06 2012 -0700
Commit:     Clinton Stimpson <clinton at elemtech.com>
CommitDate: Thu Jan 19 22:03:06 2012 -0700

    GetPrerequisites: Add test for @rpath support.

diff --git a/Tests/BundleUtilities/CMakeLists.txt b/Tests/BundleUtilities/CMakeLists.txt
index 6209c8f..bb870e8 100644
--- a/Tests/BundleUtilities/CMakeLists.txt
+++ b/Tests/BundleUtilities/CMakeLists.txt
@@ -82,3 +82,52 @@ add_custom_target(testbundleutils2_test  ALL
   DEPENDS testbundleutils1 module2
   )
 add_dependencies(testbundleutils2_test testbundleutils2)
+
+
+if(APPLE AND CMAKE_SYSTEM_VERSION VERSION_GREATER 8.0)
+######  Test a Bundle application using dependencies
+######  and @rpaths on Mac OS X 10.5 or greater
+
+  # a shared library
+  add_library(shared-3 SHARED shared.cpp shared.h)
+
+  # another shared library
+  add_library(shared2-3 SHARED shared2.cpp shared2.h)
+
+  # a framework library
+  add_library(framework-3 SHARED framework.cpp framework.h)
+  set_target_properties(framework-3 PROPERTIES FRAMEWORK 1)
+
+  # build dependencies with @rpath install name
+  set_target_properties(shared-3 shared2-3 framework-3 PROPERTIES
+                        INSTALL_NAME_DIR "@rpath"
+                        BUILD_WITH_INSTALL_RPATH 1)
+
+  # a loadable module (depends on shared2)
+  # testbundleutils1 will load this at runtime
+  add_library(module3 MODULE module.cpp module.h)
+  set_target_properties(module3 PROPERTIES PREFIX "" LINK_FLAGS "-Wl,-rpath,${CMAKE_CURRENT_BINARY_DIR}/testdir3")
+  get_target_property(module_loc module3 LOCATION)
+  target_link_libraries(module3 shared2-3)
+
+  # a non-bundle application
+  add_executable(testbundleutils3 testbundleutils3.cpp)
+  target_link_libraries(testbundleutils3 shared-3 framework-3 ${CMAKE_DL_LIBS})
+  get_target_property(loc testbundleutils3 LOCATION)
+
+  set_target_properties(testbundleutils3 module3 PROPERTIES
+                        LINK_FLAGS "-Wl,-rpath,${CMAKE_CURRENT_BINARY_DIR}/testdir3")
+
+  # add custom target to install and test the app
+  add_custom_target(testbundleutils3_test  ALL
+    COMMAND ${CMAKE_COMMAND}
+    "-DINPUT=${loc}"
+    "-DMODULE=${module_loc}"
+    "-DINPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
+    "-DOUTPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/testdir3"
+    -P "${CMAKE_CURRENT_SOURCE_DIR}/bundleutils.cmake"
+    DEPENDS testbundleutils3 module3
+    )
+
+  add_dependencies(testbundleutils3_test testbundleutils3)
+endif()
diff --git a/Tests/BundleUtilities/testbundleutils3.cpp b/Tests/BundleUtilities/testbundleutils3.cpp
new file mode 100644
index 0000000..9df13e9
--- /dev/null
+++ b/Tests/BundleUtilities/testbundleutils3.cpp
@@ -0,0 +1,33 @@
+
+#include "framework.h"
+#include "shared.h"
+#include "stdio.h"
+
+#if defined(WIN32)
+#include <windows.h>
+#else
+#include "dlfcn.h"
+#endif
+
+int main(int, char**)
+{
+  framework();
+  shared();
+
+#if defined(WIN32)
+  HANDLE lib = LoadLibraryA("module3.dll");
+  if(!lib)
+  {
+    printf("Failed to open module3\n");
+  }
+#else
+  void* lib = dlopen("module3.so", RTLD_LAZY);
+  if(!lib)
+  {
+    printf("Failed to open module3\n%s\n", dlerror());
+  }
+#endif
+
+
+  return lib == 0 ? 1 : 0;
+}

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

Summary of changes:
 Tests/BundleUtilities/CMakeLists.txt               |   49 ++++++++++++++++++++
 .../{testbundleutils2.cpp => testbundleutils3.cpp} |    8 ++--
 2 files changed, 53 insertions(+), 4 deletions(-)
 copy Tests/BundleUtilities/{testbundleutils2.cpp => testbundleutils3.cpp} (60%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list