[CMake] fixup_bundle removes runpath from qt shared libs?

Miklos Espak espakm at gmail.com
Sun Dec 10 09:04:50 EST 2017


Hi,

I'd like to package a simple application on linux. One main executable, one
shared lib, a few Qt shared libs and the xcb platform plugin.

I could package the app, but I can launch the it only if I set the
LD_LIBRARY_PATH manually, or with a wrapper script that does that.
Moreover, all the dependent libraries are copied into the bin folder of the
package, the plugin is under bin/plugins/platforms that I find a bit messy.

>From what I've learned, setting the RPATH should resolve the first issue.
So, I set it to "$ORIGIN/", as everything is in 'bin'. However, the
application still does not start without setting LD_LIBRARY_PATH manually,
the xcb plugin cannot be loaded.

What I see with readelf:

1. The RPATH is set on the main executable.
2. The RPATH is not set on my shared lib.
3. The xcb plugin has a runpath set to '$ORIGIN/../../lib'. This is the
original value from the qt installation, fixup_bundle did not touch it.
4. The other qt shared libs do not have either rpath or runpath, although
they *did* have runpath in the Qt install directory from where they had
been copied over.

Is this what should happen? 2. and 4. looks wrong to me. 3. is good, but it
would be even better if I could instruct the fixup_bundle function to copy
the libraries to the lib folder, not the bin, like with the install command.

Is there any way to get this work?

Thanks for any hints.

Cheers,
Miklos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171210/33169c78/attachment-0001.html>


More information about the CMake mailing list