[CMake] Is INSTALL_RPATH Meant to be Relative to CMAKE_INSTALL_PREFIX?

Alexander Neundorf a.neundorf-work at gmx.net
Tue Feb 5 16:02:01 EST 2013


On Tuesday 05 February 2013, David Narvaez wrote:
> On Tue, Feb 5, 2013 at 3:29 PM, Alexander Neundorf
> 
> <a.neundorf-work at gmx.net> wrote:
> > What exactly are you building ?
> > Is LIB_INSTALL_DIR preset somewhere ?
> 
> The software in question is GammaRay, see
> 
> https://github.com/KDAB/GammaRay/blob/master/CMakeLists.txt#L124
> 
> where it sets the LIB_INSTALL_DIR variable (thus avoiding the
> _set_fancy part, I think), and the issue reported here
> 
> https://github.com/KDAB/GammaRay/issues/36

Does GammaRay use KDE ?
Ah, I see, e.g. kjobtracker.
So it uses FindKDE4Internal.cmake, then LIB_INSTALL_DIR should not be set like 
this, because it leads to such bad RPATHs, as you see it.

So either LIB_INSTALL_DIR should be set absolute, or unset() before 
find_package(KDE4).

To make it work for you, set it to 
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")

Alex


More information about the CMake mailing list