[vtkusers] Interacting with VTK under Mac OS X

Mike Jackson imikejackson at gmail.com
Fri Mar 16 13:50:36 EDT 2007


So  I have tried all sorts of variations of SET_TARGET_PROPERTIES with
> CMAKE_INSTALL_RPATH
> CMAKE_INSTALL_NAME_DIR
and I am not getting what I want. Here is part of my CMakeLists.txt  
file.

ADD_LIBRARY(CTMDCore SHARED ${SOURCES})

SET_TARGET_PROPERTIES(CTMDCore
   PROPERTIES
   CMAKE_BUILD_WITH_INSTALL_RPATH ON
   SKIP_BUILD_RPATH ON
   INSTALL_RPATH /usr/local
   #CMAKE_INSTALL_NAME_DIR "@executable_path/../PlugIns"
   )

INSTALL(TARGETS CTMDCore
   LIBRARY DESTINATION lib
   )

So either I am misunderstanding what I am supposed to do or this  
doesn't work on OS X. I am leaning more towards the second.. ;-)


-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Mar 16, 2007, at 12:06 PM, Brad King wrote:

> Martin Costabel wrote:
>> Mike Jackson wrote:
>>> Here is the deal. You have TWO choices. Pick ONE..
>>
>> Unfortunately, both don't make sense when you use a package  
>> manager like
>> MacPorts or Fink or even Xcode. It is a pity that the cmake  
>> developers
>> don't understand this.
>
> We understand it just fine.  CMake 2.4 has full support for rpath and
> install_name with different settings for build tree and install tree.
> It's documented in the SET_TARGET_PROPERTIES command.  A packager can
> get the VTK binaries to install with the desired rpath or install_name
> by setting these variables in the cache with the -D option on the  
> CMake
> command line:
>
> CMAKE_INSTALL_RPATH
> CMAKE_INSTALL_NAME_DIR
>
>> In linux, it is quite obvious that you have *three* locations, the  
>> build
>> tree, the package build tree where the first provisional installation
>> happens, and the final install location. For any package manager  
>> system,
>> even on MacOSX, the situation is the same. Cmake doesn't understand
>> this, while gnu libtool, for example, has sophisticated and well- 
>> tested
>> methods to implement this on MacOSX.
>
> CMake does support this.  The initial build tree location is
> configurable by EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH.  The
> install tree location is specified with the INSTALL commands.  The
> provisional install location for packaging is set by using DESTDIR
> during install.
>
> The only thing it won't do is setup the rpath or install_name in the
> DESTDIR directory since AFAIK apps do not need to run from it  
> because it
> is meant for creating tarballs or packages.
>
>> A final remark:
>> We are talking only about install_name here, but the situation is  
>> worse
>> with respect to compatibility_version which the cmake people do  
>> not seem
>> to have heard about, but which is also an important feature of Darwin
>> dylibs.
>
> It's true that this is not currently supported by CMake, but CMake  
> does
> do the soname-based symlink stuff to make sure the proper libraries  
> are
> found.  There is a feature request here for setting the
> compatibility_version:
>
> http://www.cmake.org/Bug/bug.php?op=show&bugid=4383
>
> -Brad
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/ 
> Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list