Ticket #14426: vtk-5.0-install.patch

File vtk-5.0-install.patch, 4.5 KB (added by ajb78@…, 16 years ago)
Line 
1Message-ID: <45FB2663.1010100@kitware.com>
2Date: Fri, 16 Mar 2007 19:21:07 -0400
3From: Brad King <brad.king@kitware.com>
4To: Martin Costabel <costabel@wanadoo.fr>
5Subject: Re: [vtkusers] Interacting with VTK under Mac OS X
6Cc: vtkusers@vtk.org
7
8This is a multi-part message in MIME format.
9--------------020804060404070505000209
10Content-Type: text/plain; charset=ISO-8859-1
11Content-Transfer-Encoding: 7bit
12
13Martin 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
23The reason it doesn't work in VTK 5.0 is because that was released
24before CMake 2.4 so it does a big hack to prevent installation with any
25kind of rpath enabled.  Also the default behavior for the release branch
26is to have rpaths off.  Apply the attached patch to re-enable
27installation with rpaths.  Then run
28
29cmake ../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
35This should get it working for most of the libraries.  Then instead of
36using -DCMAKE_INSTALL_NAME_DIR:STRING=/sw/lib you can add
37
38SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib)
39
40to the source tree.  You may also need to use SET_TARGET_PROPERTIES to
41tweak the setting for a few targets, but probably not.
42
43-Brad
44
45--------------020804060404070505000209
46Content-Type: text/x-diff;
47 name="vtk-5.0-install.patch"
48Content-Transfer-Encoding: 7bit
49Content-Disposition: inline;
50 filename="vtk-5.0-install.patch"
51
52Index: CMakeLists.txt
53===================================================================
54RCS file: /cvsroot/VTK/VTK/CMakeLists.txt,v
55retrieving revision 1.341.2.19
56diff -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 ----
77Index: CMake/vtkSelectSharedLibraries.cmake
78===================================================================
79RCS file: /cvsroot/VTK/VTK/CMake/vtkSelectSharedLibraries.cmake,v
80retrieving revision 1.1
81diff -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
106Content-Type: text/plain; charset="us-ascii"
107MIME-Version: 1.0
108Content-Transfer-Encoding: 7bit
109Content-Disposition: inline
110
111_______________________________________________
112This is the private VTK discussion list.
113Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
114Follow this link to subscribe/unsubscribe:
115http://www.vtk.org/mailman/listinfo/vtkusers
116
117--------------020804060404070505000209--
118
119
120