RPATH problems in kdelibs
Alexander Neundorf
neundorf at kde.org
Sun Dec 10 23:34:54 CET 2006
On Saturday 09 December 2006 22:14, Thiago Macieira wrote:
> Thiago Macieira wrote:
> >Note that there's only one RPATH entry there. Why isn't Qt's libdir
> > being added?
>
> The following ugly patch is a workaround (for gcc only). I believe the
> problem is in CMake: TARGET_LINK_LIBRARIES should be automatically adding
> the RPATH components, but isn't doing so.
It does if you set the RPATH related target properties correctly:
set(CMAKE_INSTALL_RPATH ${LIB_INSTALL_DIR} )
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
The last option is the one which makes cmake automatically use the paths to
all used libs as RPATH. Yes, this is probably the most complicated
combination of settings you have to do anywhere in cmake.
Or for a single target to override the defaults:
set_target_properties(kdewidgets PROPERTIES
INSTALL_RPATH ${LIB_INSTALL_DIR}
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH_USE_LINK_PATH TRUE)
I committed this as patch to kdelibs/kdewidgets/CMakeLists.txt
I also added an option KDE4_USE_ALWAYS_FULL_RPATH to FindKDE4Internal.cmake.
If you set this to TRUE, everything will be linked with the full RPATH.
Did you have luck with looking for a RPATH-editing tool ?
Bye
Alex
--
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org - http://www.kde.org
alex AT neundorf.net - http://www.neundorf.net
More information about the Kde-buildsystem
mailing list