Bug 390836

Summary: Wrong RPATH in apper binary
Product: [Applications] apper Reporter: Antonio Rojas <arojas>
Component: generalAssignee: Daniel Nicoletti <dantti12>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Antonio Rojas 2018-02-21 07:53:44 UTC
After compiling 1.0.0, the apper binary gets the build-time path of libapper as RPATH, so it fails to run when installed on the system

> apper
apper: error while loading shared libraries: libapper_private.so: cannot open shared object file: No such file or directory

> readelf -d /usr/bin/apper | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/build/apper/src/build/libapper]

Strangely, this only affects the apper binary, all other binaries/libraries have the correct RPATH even though the CMakeLists.txt code is similar:
> LANG=C readelf -d /usr/lib/apper-pk-session | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib/apper]

Using cmake 3.10.2, and compiling with 

    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DAPPSTREAM=ON
Comment 1 Antonio Rojas 2018-02-21 08:20:02 UTC
https://phabricator.kde.org/D10706
Comment 2 Daniel Nicoletti 2018-02-21 10:16:32 UTC
What is odd is that it works on my system
Comment 3 Antonio Rojas 2018-02-22 08:40:03 UTC
Git commit 448527f765b1c4f9dc5452cc069baddecaf55e7e by Antonio Rojas.
Committed on 21/02/2018 at 12:57.
Pushed by arojas into branch 'master'.

Install apper binary as TARGET instead of PROGRAM

Otherwise the RPATH set in add_target_properties is ignored
Differential Revision: https://phabricator.kde.org/D10706

M  +1    -1    Apper/CMakeLists.txt

https://commits.kde.org/apper/448527f765b1c4f9dc5452cc069baddecaf55e7e