[vtkusers] Relative paths in MacOS libraries

Sean McBride sean at rogue-research.com
Thu Oct 20 11:51:44 EDT 2005


On 2005-10-20 14:36, David Flitney said:

>I'd like to include VTK libraries in the Frameworks directory of a .app 
>bundle but the libraries are not being built with the relative paths, 
>i.e.: @executable_path:../Frameworks/<libraryname>. I believe this 
>symbolic "install_name" needs to be set when the library is built. Does 
>anyone know if I can set some options in the VTK build to achieve this?

I've been meaning to try this one day...

You'll want to read the man page for 'install_name_tool', a tool that
will let you set that path to '@executable_path...', like so:

term> install_name_tool -id @executable_path/../Frameworks MyLib.dylib

Mac OS X's Mach-O format is so crappy for requiring this path at all,
but worse still the length for the path is set at build time, so if you
use install_name_tool to change it to something shorter, that's ok, but
to change to something longer you are screwed, unless you build your
library with -headerpad_max_install_names.  Also see man otool and man ld.

Because of all this, I am building vtk as static libraries, which works
quite well.  Maybe that's a solution for you too?  Its a simple change
in the cmake script.

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtkusers mailing list