PDA

View Full Version : Setting default resource search paths @rpath to @executable_path/../



zczlmes
28th July 2016, 18:17
I guess it's mostly self explanatory but after running qmake, make and macappbundler I'm able to get my .app file with all the frameworks and plugins bundled.

While trying to run the bundle, I got errors stating that the frameworks could not be found at @rpath/path/to/framework . The path was correct with respect to the bundle so i changed all instances of @rpath with install_name_tool, to @executable_path/../path/to/framework for all the frameworks and for the plugins and their dependencies.

Now the app does work, and the libraries are found.

Is there a way to set the default search paths in qt so that i don't have to do this manually, as for more involved projects it might take quite a long time. Or is there a reason why @rpath doesn't work but @executable_path does?

Sorry if I'm missing an important detail. Thanks.

jefftee
28th July 2016, 19:38
Here's what I use for my app bundle projects:


QMAKE_LFLAGS = -Wl,-rpath,@executable_path/../Frameworks

I then run macdeployqt to copy the frameworks/libraries/plugins into the app bundle. Works great, no need to run install_name_tool separately.