FindKDE4Internal.cmake: better rpath handling

Alexander Neundorf neundorf at kde.org
Mon Feb 7 21:29:20 CET 2011


On Monday 07 February 2011, Rex Dieter wrote:
> Rex Dieter wrote:
> > Alexander Neundorf wrote:
> >> On Friday 04 February 2011, Rex Dieter wrote:
> >>> Alexander Neundorf wrote:
> >>> >> 2.  copy-n-paste the aforementioned code all over (similiar to
> >>> >> what's already in FindKDEInternal)
> >>> >>
> >>> >>
> >>> >> 3.  wait for cmake to handle this better natively
> >>> >
> >>> > I think it's option 3.
> >>>
> >>> How about compromise 2+3 ? :)
> >>
> >> How do you mean that ?
> >> For now, I think we'll have to go with 2.
> >> But this shouldn't be necessary for any package which uses KDE, i.e.
> >> which does a
> >> find_package(KDE4)
> >> right ?
> >
> > Another edge-case, digikam (which does do find_package(KDE4)), for which
> > we carry the following patch, is it's use of rpath properties really
> > needed here, or is there a better solution?
>
> Arg, wrong patch, this one should make more sense.
>
> -- Rex


--- 
digikam-1.4.0/libs/imageproperties/markerclusterholderplugin/MarbleMacros.cmake.rpath       
2010-08-22 03:53:08.000000000 -0500
+++ 
digikam-1.4.0/libs/imageproperties/markerclusterholderplugin/MarbleMacros.cmake     
2010-08-25 14:22:27.973423652 -0500
@@ -38,8 +38,7 @@ endif( QTONLY )
 set_target_properties( ${_target_name} PROPERTIES 
                        INSTALL_RPATH_USE_LINK_PATH TRUE  
                        SKIP_BUILD_RPATH TRUE 
-                       BUILD_WITH_INSTALL_RPATH TRUE 
-                       INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${LIB_SUFFIX} )
+                       BUILD_WITH_INSTALL_RPATH TRUE )
 
 endmacro( marble_add_plugin _target_name )


So this ends up as:
set_target_properties( ${_target_name} PROPERTIES 
                       INSTALL_RPATH_USE_LINK_PATH TRUE  
                       SKIP_BUILD_RPATH TRUE 
                       BUILD_WITH_INSTALL_RPATH TRUE )

Not sure this makes sense.
This way it uses the RPATH from the CMAKE_INSTALL_RPATH variable. Is this what 
you want ?

If I see it correctly, this is in a macro file from marble.
Marble can be built without KDE, so for them it is necessary that they handle 
RPATH themselves

I don't think it is necessary anymore to use SKIP_BUILD_RPATH TRUE. This made 
sense when cmake still had to relink the ELF files during installation to 
change the RPATH. Since 2.6.0 I think cmake just patches the existing 
binaries, so "make install" is now also fast when the BUILD_RPATH has to be 
exchanged against the INSTALL_RPATH.

I think I would suggest something like:

set_target_properties( ${_target_name} PROPERTIES 
                       INSTALL_RPATH_USE_LINK_PATH TRUE  
                       INSTALL_RPATH ${MARBLE_INSTALL_RPATH )


with MARBLE_INSTALL_RPATH set with the logic which checks for 
IMPLICIT_LINK_DIRECTORIES etc. somewhere in one of the marble-files.


Alex






More information about the Kde-buildsystem mailing list