[vtkusers] Interacting with VTK under Mac OS X

Brad King brad.king at kitware.com
Fri Mar 16 12:06:19 EDT 2007


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



More information about the vtkusers mailing list