[Interest] To rpath or not when building Qt

Mike Jackson imikejackson at gmail.com
Tue Apr 14 18:37:32 CEST 2015


On Wed, Mar 11, 2015 at 7:59 PM, Thiago Macieira <thiago.macieira at intel.com>
wrote:

> On Wednesday 11 March 2015 23:50:52 Nikos Chantziaras wrote:
> > On 10/03/15 21:07, Scott Aron Bloom wrote:
> > > When building Qt for distribution via LGPL of a closed source product
> > > using shared libraries.
> > >
> > > What is the best method to make sure the plugins pickup the Qt
> libraries
> > > you are shipping?
> >
> > As Thiago mentioned, you can use RPATH. However, RPATH is overridable.
>
> s/overridable/non-overridable/
>
> > What you *really* want to set is RUNPATH. If you want to load the
> > plugins from a directory that exists inside the directory of your
> > executable, then use "$ORIGIN" as the prefix.
>
> I personally prefer RUNPATH, so that I can override when I want to.
>
> > For reference, if you want to use RPATH instead of RUNPATH, use:
> >
> >    -Wl,-rpath=\$ORIGIN/lib,--disable-new-dtags
> >
> > Note: it is somewhat of a nightmare to escape the "$" in "\$ORIGIN" in a
> > way that can make it undamaged to the final link command. The shell must
> > receive "\$ORIGIN", and until it makes it there, it can pass through
> > several processing stages. You might need an unholy amount of escape
> > sequences ("\\\\$ORIGIN" or similar.) Trial end error :-/
>
> See Creator's source code for the way to do it with qmake.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>

Is there a way to do this _during_ the packaging of the application? If I
add those link commands then will I not need to copy all the Qt Libraries
into my build folder? Anyone have any experience doing any of this from
CMake? It looks like CMake may have something already figured out,
Possibly...

-- 
Mike Jackson
imikejackson _at_ gee-mail dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150414/31248547/attachment.html>


More information about the Interest mailing list