Chris Wolf wrote:
[]
Have you actually built shared libraries on MacOS with CMake?  If so, maybe an 
example
of yours would be more helpful.

The following settings work for me when building vtk5.6 for Fink:

  -DCMAKE_INSTALL_NAME_DIR:STRING=/sw/lib/vtk56 \
  -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
  -DCMAKE_INSTALL_RPATH:STRING="${CMAKE_INSTALL_NAME_DIR}" \
  -DVTK_USE_RPATH=ON

In this case, during build time, that is before running make, one needs to set something like

  export DYLD_LIBRARY_PATH=`pwd`/bin

so that the newly built libraries are found in the build tree, otherwise the executables look for them in the install directory.

In principle, a second method using

  CMAKE_BUILD_WITH_INSTALL_RPATH=OFF

should also be possible, in which case cmake should use the BUILD_RPATH during building and then, at installation time, use install_name_tool to change all RPATHs to their INSTALL value. In the case of VTK, this works for the dylibs and for some of the executables, but not for python modules. Therefore I prefer the first method where the RPATH is immediately set to its INSTALL value, both in the dylibs and, by inheritance, in the executables.

--
Martin
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to