[vtkusers] Interacting with VTK under Mac OS X
Brad King
brad.king at kitware.com
Fri Mar 16 19:21:07 EDT 2007
Martin Costabel wrote:
> The problem is that, as others have answered already, that nobody seems
> to know how to get this to work. I have read the documentation and the
> sources many times forwards and backwards, and I have literally spent
> several days in vain trying to get CMake for VTK to produce
> install_names like /sw/lib/vtk/libvtkCommon.5.0.dylib.
>
> If the result of the present discussion is a working example for VTK
> libraries, I would be very glad.
The reason it doesn't work in VTK 5.0 is because that was released
before CMake 2.4 so it does a big hack to prevent installation with any
kind of rpath enabled. Also the default behavior for the release branch
is to have rpaths off. Apply the attached patch to re-enable
installation with rpaths. Then run
cmake ../VTK-5.0 \
-DCMAKE_INSTALL_PREFIX=/sw \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_NAME_DIR:STRING=/sw/lib \
-DVTK_USE_RPATH=ON
This should get it working for most of the libraries. Then instead of
using -DCMAKE_INSTALL_NAME_DIR:STRING=/sw/lib you can add
SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib)
to the source tree. You may also need to use SET_TARGET_PROPERTIES to
tweak the setting for a few targets, but probably not.
-Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtk-5.0-install.patch
Type: text/x-diff
Size: 2280 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070316/93533703/attachment.patch>
More information about the vtkusers
mailing list