[CMake] getting the rpath right on osx

Boudewijn Rempt boud at valdyas.org
Mon Nov 2 08:49:35 EST 2015


On Mon, 2 Nov 2015, Andreas Pakulat wrote:

> I think the idea of using @rpath as install name of the Qt libraries is geared towards the usecase
> of shipping Qt within the application bundle of the application. In that case all you need is set
> the rpath @executable_path/../Frameworks or so in the executable and thus the app-bundle is
> relocatable. In order to get that with CMake you'll likely need to use the BundleUtilities, though
> its been so long since I used those I don't know if they can handle this scenario out of the box.
>

Yes, that's what I'm trying to do -- well, I'm trying to do two
things. One is setup a build environment where kde apps like desktoptojson
can run, the other is creating a bundle, preferably using the same
Qt. I got quite far by manually fixing up the applications built as part
of kcoreaddons and then manually patching up the executable inside the
bundle to have the @executable_path/../Frameworks rpath added. But I'm
still not sure why with a really simple example things don't work out
of the box: I guess I had better build Qt with -norpath.

Boudewijn


More information about the CMake mailing list