4

I'm getting back into using Qt (5.0.1) after a few years away.

I'm having some trouble using QMAKE_BUNDLE_DATA to distribute dylibs and hopefully plugins in my OSX application bundle.

Here's what the relevant part of my application .pro file looks like:

macx {
        dylibs.path = $$DESTDIR_TARGET/Contents/Frameworks
        dylibs.files = $$DESTDIR/../lib/*
        QMAKE_BUNDLE_DATA += dylibs

        plugins.path = $$DESTDIR_TARGET/Contents/Plugins
        plugins.files = $$DESTDIR/../plugins/*
        QMAKE_BUNDLE_DATA += plugins
}

INSTALLS += target

I've verified that $$DESTDIR is pointing to the correct place and that files exist in that directory. I'm not great with Makefiles, but from what I understand, qmake is generating targets like:

../../../build/apps/MyApp.app/Contents/Frameworks/*:

These targets aren't referenced in the all target. Any ideas what I'm doing wrong?

Tim
  • 4,560
  • 2
  • 40
  • 64
  • Have you looked into macdeployqt? It should automatically generate the app bundle with necessary dylibs. I haven't used Qt 5.x extensively, but this link should be similar: http://stackoverflow.com/questions/2809930/macdeployqt-and-third-party-libraries – Cameron Tinker Apr 10 '13 at 17:21
  • Yeah, but all it does it copy the correct Qt frameworks. It doesn't handle my own libraries/frameworks. What I want is for qmake;make; to produce a full application bundle. – Tim Apr 10 '13 at 19:29
  • If you copy the dylibs/frameworks manually to the app bundle, does the application work on a non-development machine? – Cameron Tinker Apr 10 '13 at 19:33
  • Yes it does... I just want to automate the process. – Tim Apr 22 '13 at 16:16

1 Answers1

2

I gave up on QMAKE_BUNDLE_DATA, from what I can tell it doesn't work for app_bundle targets.

Instead I'm using INSTALLS and make install to generate the app bundle then triggering a call to macdeployqt to finish things off.

It isn't ideal, but it does the trick.

Tim
  • 4,560
  • 2
  • 40
  • 64