1 | Message-ID: <45FB2663.1010100@kitware.com> |
---|
2 | Date: Fri, 16 Mar 2007 19:21:07 -0400 |
---|
3 | From: Brad King <brad.king@kitware.com> |
---|
4 | To: Martin Costabel <costabel@wanadoo.fr> |
---|
5 | Subject: Re: [vtkusers] Interacting with VTK under Mac OS X |
---|
6 | Cc: vtkusers@vtk.org |
---|
7 | |
---|
8 | This is a multi-part message in MIME format. |
---|
9 | --------------020804060404070505000209 |
---|
10 | Content-Type: text/plain; charset=ISO-8859-1 |
---|
11 | Content-Transfer-Encoding: 7bit |
---|
12 | |
---|
13 | Martin Costabel wrote: |
---|
14 | > The problem is that, as others have answered already, that nobody seems |
---|
15 | > to know how to get this to work. I have read the documentation and the |
---|
16 | > sources many times forwards and backwards, and I have literally spent |
---|
17 | > several days in vain trying to get CMake for VTK to produce |
---|
18 | > install_names like /sw/lib/vtk/libvtkCommon.5.0.dylib. |
---|
19 | > |
---|
20 | > If the result of the present discussion is a working example for VTK |
---|
21 | > libraries, I would be very glad. |
---|
22 | |
---|
23 | The reason it doesn't work in VTK 5.0 is because that was released |
---|
24 | before CMake 2.4 so it does a big hack to prevent installation with any |
---|
25 | kind of rpath enabled. Also the default behavior for the release branch |
---|
26 | is to have rpaths off. Apply the attached patch to re-enable |
---|
27 | installation with rpaths. Then run |
---|
28 | |
---|
29 | cmake ../VTK-5.0 \ |
---|
30 | -DCMAKE_INSTALL_PREFIX=/sw \ |
---|
31 | -DBUILD_SHARED_LIBS=ON \ |
---|
32 | -DCMAKE_INSTALL_NAME_DIR:STRING=/sw/lib \ |
---|
33 | -DVTK_USE_RPATH=ON |
---|
34 | |
---|
35 | This should get it working for most of the libraries. Then instead of |
---|
36 | using -DCMAKE_INSTALL_NAME_DIR:STRING=/sw/lib you can add |
---|
37 | |
---|
38 | SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib) |
---|
39 | |
---|
40 | to the source tree. You may also need to use SET_TARGET_PROPERTIES to |
---|
41 | tweak the setting for a few targets, but probably not. |
---|
42 | |
---|
43 | -Brad |
---|
44 | |
---|
45 | --------------020804060404070505000209 |
---|
46 | Content-Type: text/x-diff; |
---|
47 | name="vtk-5.0-install.patch" |
---|
48 | Content-Transfer-Encoding: 7bit |
---|
49 | Content-Disposition: inline; |
---|
50 | filename="vtk-5.0-install.patch" |
---|
51 | |
---|
52 | Index: CMakeLists.txt |
---|
53 | =================================================================== |
---|
54 | RCS file: /cvsroot/VTK/VTK/CMakeLists.txt,v |
---|
55 | retrieving revision 1.341.2.19 |
---|
56 | diff -c -3 -p -r1.341.2.19 CMakeLists.txt |
---|
57 | *** CMakeLists.txt 6 Feb 2007 18:51:59 -0000 1.341.2.19 |
---|
58 | --- CMakeLists.txt 16 Mar 2007 23:14:52 -0000 |
---|
59 | *************** INCLUDE(${CMAKE_ROOT}/Modules/CMakeExpor |
---|
60 | *** 40,54 **** |
---|
61 | # Choose static or shared libraries. |
---|
62 | INCLUDE(${VTK_SOURCE_DIR}/CMake/vtkSelectSharedLibraries.cmake) |
---|
63 | |
---|
64 | - # Disable the install targets if using the rpath feature. |
---|
65 | - IF(NOT WIN32) |
---|
66 | - IF(VTK_USE_RPATH) |
---|
67 | - SET(VTK_INSTALL_NO_RUNTIME 1) |
---|
68 | - SET(VTK_INSTALL_NO_DEVELOPMENT 1) |
---|
69 | - SET(VTK_INSTALL_NO_DOCUMENTATION 1) |
---|
70 | - ENDIF(VTK_USE_RPATH) |
---|
71 | - ENDIF(NOT WIN32) |
---|
72 | - |
---|
73 | #----------------------------------------------------------------------------- |
---|
74 | # Output directories. |
---|
75 | IF(NOT LIBRARY_OUTPUT_PATH) |
---|
76 | --- 40,45 ---- |
---|
77 | Index: CMake/vtkSelectSharedLibraries.cmake |
---|
78 | =================================================================== |
---|
79 | RCS file: /cvsroot/VTK/VTK/CMake/vtkSelectSharedLibraries.cmake,v |
---|
80 | retrieving revision 1.1 |
---|
81 | diff -c -3 -p -r1.1 vtkSelectSharedLibraries.cmake |
---|
82 | *** CMake/vtkSelectSharedLibraries.cmake 11 Aug 2005 19:49:09 -0000 1.1 |
---|
83 | --- CMake/vtkSelectSharedLibraries.cmake 16 Mar 2007 23:14:52 -0000 |
---|
84 | *************** IF(NOT VTK_SHARED_LIBRARIES_SELECTED) |
---|
85 | *** 48,64 **** |
---|
86 | IF(VTK_USE_RPATH) |
---|
87 | # We will use rpath support. Tell CMake not to skip it. |
---|
88 | SET(CMAKE_SKIP_RPATH 0 CACHE INTERNAL "Whether to build with rpath." FORCE) |
---|
89 | - |
---|
90 | - # If someone is trying to install do not do an entire build with |
---|
91 | - # the wrong rpath feature setting just to report failed |
---|
92 | - # installation. |
---|
93 | - SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) |
---|
94 | - |
---|
95 | - # Add a dummy target and attach an install rule that will always fail |
---|
96 | - # and produce a message explaining why installation is disabled. |
---|
97 | - ADD_CUSTOM_TARGET(vtk_install_disabled) |
---|
98 | - SET_TARGET_PROPERTIES(vtk_install_disabled PROPERTIES |
---|
99 | - PRE_INSTALL_SCRIPT ${VTK_SOURCE_DIR}/CMake/InstallDisabled.cmake) |
---|
100 | ELSE(VTK_USE_RPATH) |
---|
101 | # We will not use rpath support. Tell CMake to skip it. |
---|
102 | SET(CMAKE_SKIP_RPATH 1 CACHE INTERNAL "Whether to build with rpath." FORCE) |
---|
103 | --- 48,53 ---- |
---|
104 | |
---|
105 | --------------020804060404070505000209 |
---|
106 | Content-Type: text/plain; charset="us-ascii" |
---|
107 | MIME-Version: 1.0 |
---|
108 | Content-Transfer-Encoding: 7bit |
---|
109 | Content-Disposition: inline |
---|
110 | |
---|
111 | _______________________________________________ |
---|
112 | This is the private VTK discussion list. |
---|
113 | Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ |
---|
114 | Follow this link to subscribe/unsubscribe: |
---|
115 | http://www.vtk.org/mailman/listinfo/vtkusers |
---|
116 | |
---|
117 | --------------020804060404070505000209-- |
---|
118 | |
---|
119 | |
---|
120 | |
---|