On Sunday 20 November 2011, Laszlo Papp wrote: > > Next is RPATH. Are you building with RPATH, or did you disable RPATH ? > > With RPATH will be hard. > > When linking something against > > /home/apol/QtSdk/Madde/sysroots/.../usr/lib/libnepomukquery.so.4.7.0, > > cmake will figure out that some executable needs > > "/home/apol/QtSdk/Madde/sysroots/.../usr/lib/" as RPATH. > > This would be the correct RPATH from the POV of the (build)host, but > > completely wrong for the target host. > > I am not getting it, but this might be because I have some > misunderstand on my side. I have an example here: > http://community.kde.org/KDE_Mobile/Harmattan#Packaging_your_KDE_Mobile_app > lication_with_shared_libraries
That page says "-DCMAKE_PREFIX_INSTALL=/usr" Is that a typo, or did somebody somewhere add a variable CMAKE_PREFIX_INSTALL ? I would expect it should be CMAKE_INSTALL_PREFIX ? > > All I do on the my computer is using "-DCMAKE_INSTALL_RPATH=/opt/test/lib". Oh, you are setting this from the outside. Interesting, I never tried that. > On the device after my deploying: > ldd -r /usr/bin/tutorial1 > libkdecore.so.5 => /opt/test/lib/libkdecore.so.5 (0x3aad3000) > libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x3ad95000) > ... > > It seems to use the proper one even if I had the > /usr/lib/libkdecore.so.5 during the compilation. In the not-yet-installed binaries you get the BUILD_RPATH, which is complete and which is computed automatically by cmake (except you set CMAKE_SKIP_BUILD_RPATH to TRUE). During installation, the BUILD_RPATH is replaced with the INSTALL_RPATH. This consists of the cmake variable CMAKE_INSTALL_RPATH, and an automatically computed part if CMAKE_INSTALL_RPATH_USE_LINK_PATH is set to TRUE (we do this, see FindKDE4Internal.cmake, search for RPATH). CMAKE_INSTALL_RPATH is in your case left untouched in FindKDE4Internal.cmake, you set it from the outside, so this is what will be the install RPATH in the end. Look at FindKDE4Internal.cmake and KDE4Macros.cmake, there is only one place where RPATH settings are set, this is in FindKDE4Internal.cmake, and it is also commented. The macro KDE4_HANDLE_RPATH_FOR_EXECUTABLE() doesn't actually do anything RPATH-related anymore, nowadays it only creates the wrapper shell scripts/batch files for running executables from the build tree if RPATH is completely disabled. Alex _______________________________________________ Kde-buildsystem mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-buildsystem
