[QBS] Internal libraries, RPATH and Qt Creator

Christian Kandeler christian.kandeler at theqtcompany.com
Thu Apr 30 10:04:42 CEST 2015


On 04/30/2015 06:03 AM, Christian Gagneraud wrote:
> I think I got confused by how Qtc is doing it:

I'll comment on the Linux-specific parts as an example.

> QtcLibrary.qbs:
>       cpp.rpaths: qbs.targetOS.contains("osx")
>               ? ["@loader_path/..", "@executable_path/.."]
>               : ["$ORIGIN", "$ORIGIN/.."]

This specifies where Qt Creator's libraries find other Qt Creator 
libraries: At their own location ("$ORIGIN") and at the directory above 
-- I must admit I am currently unsure why the latter is needed. Perhaps 
we used to have stuff in lib/ as well as in lib/qtcreator/?

> QtcPlugin.qbs:
>       cpp.installNamePrefix: "@rpath/PlugIns/"
>       cpp.rpaths: qbs.targetOS.contains("osx")
>           ? ["@loader_path/..", "@loader_path/", "@executable_path/.."]
>           : ["$ORIGIN", "$ORIGIN/.."]

This specifies where Creator's plugins find other plugins (at their own 
location, "$ORIGIN", which will be <install 
prefix>/lib/qtcreator/plugins/), and other Creator libraries 
("$ORIGIN/..", which will be <install prefix>/lib/qtcreator/).

There's also QtcTool.qbs and app.qbs, which specify where executables 
find Creator libraries: ["$ORIGIN/../" + project.ide_library_path].

You get the idea. You dedice how your project is laid out, and then you 
set rpath so that the dependency binary is found relative to the one 
that requires it at runtime.


Christian




More information about the Qbs mailing list