[vtkusers] Interacting with VTK under Mac OS X

Sean McBride sean at rogue-research.com
Wed Mar 14 14:14:24 EDT 2007


On 3/14/07 1:26 PM, Mike Jackson said:

>Here is the deal. You have TWO choices. Pick ONE..
>
>1) Build with RPATH=ON. This will encode the full path to the  
>libraries in each library. So basically, build VTK with RPATH=ON and  
>then DO NOT MOVE THE LIBRARIES from wherever cmake puts them. In  
>Xcode, you reference these libraries IN PLACE. This is what you want  
>to use when developing.
>
>2) Build with RPATH=OFF but do a "make install". This will place the  
>libraries in /usr/local/lib by default and Encode in each library  
>where the library is located. This is what you want to use when  
>Deplorying your app to other people. You will need an installer than  
>places all the Vtk libs in /usr/local/lib for the user. While this  
>will work and some companies do it this way, this is really NOT the  
>mac way of doing things.
>
>And a few comments from below: OS X does NOT put the path in the  
>libraries name, the linker does only with flags that are set by CMake.
>
>What I would like to see are two more options for OS X:
>   1) Do not encode ANY path in the libraries. OS X by DEFAULT will  
>look in /usr/lib and /usr/local/lib (preferable) for libraries. This  
>would be a better situation.
>   2) Provide an option to set the "install_name" for the libraries,  
>or at least the prefix. I have my own hack in the OS X CMake module  
>that allows me to do this. Thus I can compile my VTK libs with a path  
>like the following: "@executable_path/../Libs" which allows me to  
>embed all the VTK libs in my .app package. This allows true "Drag and  
>Drop" installation of your application onto the OS X system. No  
>Installer needed.
>
>You should NOT have to mess with DYLD_LIBRARY_PATH environment  
>variables if this is setup correctly.

For all these reasons, I always build VTK as static libraries, and
simply add those static libs to my actual application's Xcode project.

-- 
____________________________________________________________
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