[CMake] Installed project with shared libs

Brad King brad.king at kitware.com
Thu Feb 23 16:27:12 EST 2006


Brad King wrote:
> Zachary Pincus wrote:
>> It seems like this issue will arise with any CMake-driven project,  
>> and not just ITK. So, in its current state, can CMake be used to  
>> create shared libs that work properly when installed? I know that  
>> CMake just got custom rpath support (thanks Brad!), so I'm curious as  
>> to what ITK (or any CMake project that installs shared libs) would  
>> need to do to support this.

You can set CMAKE_SKIP_RPATH in the advanced cache options to disable 
the rpaths that point at the build tree (this works with any CMake 
version).  Then the installed libraries will not have any rpath. 
Programs can be executed by adding their location to LD_LIBRARY_PATH.

The long-term solution for installed ITK binaries is to follow what I 
did last year for VTK.  The shared libraries should be given version 
numbers and installed to PREFIX/lib instead of 
PREFIX/lib/InsightToolkit.  Then they will not need rpath at all.

-Brad


More information about the CMake mailing list