From kde-buildsystem Sun Dec 10 22:34:54 2006 From: neundorf () kde ! org (Alexander Neundorf) Date: Sun, 10 Dec 2006 22:34:54 +0000 To: kde-buildsystem Subject: RPATH problems in kdelibs Message-Id: <200612102334.54970.neundorf () kde ! org> X-MARC-Message: https://marc.info/?l=kde-buildsystem&m=116644632533681 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