shoosh
shoosh

Reputation: 79011

Using private frameworks for QT in xcode 4.3

The Mac QT Installer puts its shared libraries under /Library/Frameworks/QtXXX.Framework.
I'm building a QT application using a qmake-generated xcode project. I'd like to add these frameworks as private framewords inside my app bundle for easy deployment.

I've tried various options for doing this but I don't seem to be able to make it work. What I did -

When I change the name of the original framework so it would appear that it's not there, the app crashes and says that it doesn't find the needed framework. What am I doing wrong?

Using xcode 4.3 on OSX 10.7.3

Upvotes: 1

Views: 707

Answers (1)

Frank Osterfeld
Frank Osterfeld

Reputation: 25165

Some options to deploy a Qt application on Mac:

  • Qt comes with the macdeployqt tool, to bundle Qt with the built app bundle. The tool is a bit limited though and might or might not do what you want.
  • CMake comes with DeployQt4, which can also be used for deployment only, in case one doesn't want to use cmake for the build as well.
  • One can write his own script using install_name_tool as described in your link. If it doesn't work, check with otool -L if you replaced all absolute paths in the executable and bundled libraries. You will have to fix the paths for the bundled libraries, too! (recursively, so to say).

The latest released cmake version (2.8.7) doesn't support XCode 4.3 properly though: Since Xcode 4.3, files previously being installed to /Developer are now in /Applications/Xcode.app/Contents/Developer. cmake still expects them in /Developer. That is fixed in cmake master but not released yet. A workaround is to create a symlink:

ln -s /Applications/Xcode.app/Contents/Developer /Developer

Upvotes: 1

Related Questions