0

With Qt/C++ (QT 5.5) on OSX, is there a way to exclude frameworks for APIs I'm not using when running through macdeployqt?

For instance, I don't think I need the following frameworks:

  • QtQml.framework
  • QtQuick.framework
  • QtWebChannel.framework (I'm using the webkit and webkit bridge, so I assume I don't need the QtWebChannel framework?)
  • QtMultimedia.framework
  • QtMultimediaWidgets.framework
  • QtSensors.framework
  • QtOpenGL.framework
Volomike
  • 23,743
  • 21
  • 113
  • 209

1 Answers1

2

Here's what I'd recommend: try removing those frameworks from the app bundle manually one by one, then running your application. This is just a matter of opening the app bundle in Finder (or cd-ing into it from the command line) and moving the frameworks to another folder.

You'll likely be surprised by how many of these frameworks turn out to be necessary -- they all have inter-dependencies. The only way around this is to build Qt from source, and configure it such that you only build the modules you need.

As for macdeployqt itself it's a very general tool that won't fit every application's needs. If you're able to remove any of those frameworks, your best bet is to write a script that runs macdeployqt and then fixes up the output. The macdeployqt tool is still rather new (as of Qt 5.5) and as such there's definitely still bugs to be fixed and features to be implemented. So your only option now is to work around its defects.

MrEricSir
  • 8,044
  • 4
  • 30
  • 35
  • I tried that already. Unfortunately, the application won't run without that. I have no idea why. I'm not calling a single QML or QtQuick thing at all, yet need to ship with that framework. – Volomike Nov 29 '15 at 21:04
  • Like I (tried to) explain in the answer, the linkage between frameworks is established at build time, not when you run macdeployqt. So if you don't need QML your only option is to build Qt without it. – MrEricSir Nov 29 '15 at 21:17
  • I found that the default QtWebKit.framework bundle is a major culprit. It's the one that includes the QtQuick and QtQml stuff even though I'm not using those. The only workaround is to get the source of QtWebKit, find the QtQuick and QtQML dependencies in the QtWebKit.framework, remove those, and recompile. Then, swap that framework bundle out with this new one. Then, I can then remove the QtQml.framework and QtQuick frameworks. Long story short -- that's a huge hurdle and not worth my time. – Volomike Nov 29 '15 at 21:42