Review Request 113649: fix rpath handling

Alexander Neundorf neundorf at kde.org
Tue Nov 5 18:06:22 UTC 2013



> On Nov. 5, 2013, 4:53 p.m., Alexander Neundorf wrote:
> > If LIB_INSTALL_DIR is a cache variable, i.e. if it can be set from the outside (I guess it can), you should test before whether it is an 
> > absolute path or not, and make it absolute if it isn't:
> > 
> > set(_abs_LIB_INSTALL_DIR "${LIB_INSTALL_DIR}")
> >   if (NOT IS_ABSOLUTE "${_abs_LIB_INSTALL_DIR}")
> >      set(_abs_LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
> >   endif()
> >
> 
> Rex Dieter wrote:
>     someone just commented in #kde-devel that even CMAKE_INSTALL_PREFIX can be relative?  then what?  test that for absolute-ness too?
> 
> Rex Dieter wrote:
>     Looking at FindPhononInternal.cmake, I see a comment there that LIB_INSTALL_DIR is expected to be relative, so does checking if it isn't even make sense?

I have never seen a relative CMAKE_INSTALL_PREFIX.
Probably it is possible to set it to a relative path, but I have never seen somebody doing that nor do I know why somebody should do that. I'd say, it is expected that CMAKE_INSTALL_PREFIX is absolute. So for now, I would ignore the case of a non-absolute CMAKE_INSTALL_PREFIX.

I just had a look at FindPhononInternal.

include(GNUInstallDirs)
...
set(LIB_INSTALL_DIR             "${CMAKE_INSTALL_LIBDIR}" )

CMAKE_INSTALL_DIR comes from GNUInstallDirs.cmake:

if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
  ...
  set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
endif()

So CMAKE_INSTALL_LIBDIR is a cache variable and can be edited by the user, and is not guaranteed to be an absolute path, but can be.

So, if I see things correctly, LIB_INSTALL_DIR can be both a relative or an absolute path and I would recommend to test for that.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113649/#review43084
-----------------------------------------------------------


On Nov. 5, 2013, 4:38 p.m., Rex Dieter wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113649/
> -----------------------------------------------------------
> 
> (Updated Nov. 5, 2013, 4:38 p.m.)
> 
> 
> Review request for Build System and Phonon.
> 
> 
> Repository: phonon
> 
> 
> Description
> -------
> 
> Prior to this patch, the cmake code queries/uses ${LIB_INSTALL_DIR} which is a relative path, so an unconditional (relative) rpath gets added.
> 
> 
> Diffs
> -----
> 
>   cmake/FindPhononInternal.cmake b48bfaf 
> 
> Diff: http://git.reviewboard.kde.org/r/113649/diff/
> 
> 
> Testing
> -------
> 
> build/install phonon-4.7.0 to system path on fedora 20 without rpath.
> 
> 
> Thanks,
> 
> Rex Dieter
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20131105/ffa10797/attachment.html>


More information about the Kde-buildsystem mailing list