3

I've created a Qt project using CMake as build system. I would like to include in the deployment phase, the necessary Qt frameworks

Qt3Support.framework/ QtNetwork.framework/  QtXml.framework/
QtCore.framework/     QtOpenGL.framework/   
QtGui.framework/      QtSql.framework/ 

in order to be ready to distribute my program as standalone dmg.

This is usually done with macdeployqt command but it gives me a lot of errors like this:

ERROR: "strip: for architecture x86_64 object:
/Users/rs/build/myapp.app/Contents/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns
 malformed object (unknown load command 5)

so I want to be able to do it directly in the deployment phase, is it possible?

linello
  • 8,451
  • 18
  • 63
  • 109
  • `DeployQt4.cmake` module might be relevant. – arrowd Sep 07 '12 at 12:36
  • Ok I've tried the DeployQt4 module but it's very difficult to find working examples of it. And as second thing it crashes! I tried the example on the kitware documentation at this site http://www.vtk.org/Wiki/BundleUtilitiesExample and downloaded the example test, but I always get the error: `CMake Error at /Applications/CMake 2.8-9.app/Contents/share/cmake-2.8/Modules/BundleUtilities.cmake:784 (message): error: verify_app failed Call Stack (most recent call first): /Applications/CMake 2.8-9.app/Contents/share/cmake-2.8/Modules/BundleUtilities.cmake:666 (verify_app)` – linello Sep 07 '12 at 15:58

1 Answers1

2

I was using DeployQt4 and BundleUtilities for some time until I ran into a problem with it which wasn't easy to fix according to one of the authors.

I ended up writing a ruby script that does what BundleUtilities does barring that problem. My script has a limitation currently comparing to the BundleUtilities - it doesn't handle bundles with multiple executables. Writing the same functionality in cmake is beyond my degree of masochism (I managed to understand what BundleUtilities does and how but was appalled by the contraptions they had to use to organize data in memory).

The script itself is available here: https://github.com/artm/vision-ui-skeleton/blob/master/ruby/fixup/fixup.rb

It is used from cmake at the bottom of: https://github.com/artm/vision-ui-skeleton/blob/master/cmake/QArtmRelease.cmake

It works with ruby that comes with OSX 10.6.x and probably higher.

artm
  • 3,559
  • 1
  • 26
  • 36