[CMake] Remove all rpaths on install

Alexander Neundorf a.neundorf-work at gmx.net
Fri Feb 20 13:25:34 EST 2009

On Friday 20 February 2009, Orion Poplawski wrote:
> We need to make sure that all rpaths are removed on install when
> building Fedora rpms.  How can we achieve this?  We still see /usr/lib64
> being added (twice!) to items:
>   0x000000000000000f (RPATH)              Library rpath:
> [/usr/lib64:/usr/lib64]
> Get "/usr/lib:/usr/lib" on 32-bit machines.
> This is with cmake 2.6.3 RC 13
> -DINSTALL_RPATH="" (or -DCMAKE_INSTALL_RPATH="" which should it be?)

It's CMAKE_INSTALL_RPATH. INSTALL_RPATH is the name of the target property, 
which you can use to override the global setting.
What you do will not have an effect if:
-CMAKE_INSTALL_RPATH is set somewhere inside the CMakeLists, this later set() 
command will override the one given from the command line

If there is no explicit RPATH handling in the project, the RPATH will be 
removed completely from the binaries when installing them by default.

You should be able to disable RPATH completely by setting the variable 
CMAKE_SKIP_RPATH to TRUE. This is a cache variable, i.e. you have to set it 
in the cache.


> seems to have no effect.

More information about the CMake mailing list