Diane's World

I take the 5th


Mon, 13 Feb 2006

Qt Mac

I wanted to make sure that I can build Qt apps on os x, the documentation is a little bit weak, especially with respect to explaing how to get qmake to automatically shove the right framework components into the .app bundle.

However the following steps were able to build an appropriate bundle.

export QTDIR=/usr/local/Trolltech/Qt-4.1.0 export APP=hello mkdir ${APP}/Contents/Frameworks rsync -av --exclude "_debug" --exclude "Headers" ${QTDIR}/lib/QtCore.framework ${APP}.app/Contents/Frameworks rsync -av --exclude "_debug" --exclude "Headers" ${QTDIR}/lib/QtGui.framework ${APP}.app/Contents/Frameworks rsync -av --exclude "_debug" --exclude "Headers" ${QTDIR}/lib/QtOpenGL.framework ${APP}.app/Contents/Frameworks

install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore ${APP}.app/Contents/Frameworks/QtCore.framework/Versions/4.0/QtCore install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui ${APP}.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui install_name_tool -id @executable_path/../Frameworks/QtOpenGL.framework/Versions/4.0/QtOpenGL ${APP}.app/Contents/Frameworks/QtOpenGL.framework/Versions/4.0/QtOpenGL

install_name_tool -change ${QTDIR}/lib/QtCore.framework/Versions/4.0/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore ${APP}.app/Contents/MacOS/${APP} install_name_tool -change ${QTDIR}/lib/QtCore.framework/Versions/4.0/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui ${APP}.app/Contents/MacOS/${APP} install_name_tool -change ${QTDIR}/lib/QtCore.framework/Versions/4.0/QtOpenGL @executable_path/../Frameworks/QtOpenGL.framework/Versions/4.0/QtOpenGL ${APP}.app/Contents/MacOS/${APP}

install_name_tool -change ${QTDIR}/lib/QtCore.framework/Versions/4.0/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore ${APP}.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui install_name_tool -change ${QTDIR}/lib/QtCore.framework/Versions/4.0/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore ${APP}.app/Contents/Frameworks/QtOpenGL.framework/Versions/4.0/QtOpenGL

There's probably some way of emedding that in a .pro file, but I don't know it yet. Also the cp -R really should be modified to not copy the header and debug parts of the framework if one wants a reasonable download size.

[20:00] | [] | # | G


menu

About Diane Trout
Blog

calendar

< February 2006 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728    

categories

/ (123)
  geek/ (37)
    debian/ (2)
    programming/ (1)
    t41/ (6)
    voip/ (1)
  government/ (7)
    tac/ (3)
  life/ (8)
    transhuman/ (1)
    vegan/ (2)
      recipes/ (2)
  study/ (49)
    arma/ (1)
    bi188/ (8)
    cs191a/ (6)
    ese166/ (25)
  work/ (21)
    compclust/ (6)
    sigmoid/ (1)
    talks/ (1)