OSX deployment ~ frameworks folder = 50MB

  • I used the great macdeloyqt-tool on my .app and was pretty impressed with the 50MB frameworks-folder.
    As a .dmg-file it still weights 22MB which is too much for my little application (on Windows I got it down to 7 MB).

    What are good way to decreases the size besides compiling Qt itself with stuff disabled?

    EDIT: I just saw each library is there twice (same size)

    |- Resources
    |- Versions
    |- 4
    |- QtGui ===|
    |- Current |---> same file
    |- QtGui ===|@

    Can I remove one of them?

  • There are symlinks - so they are not duplicates, there is single instances of binaries.
    If not, then script which is making deployment not right.

    Also you can try "strip" command to decrease size of binaries

  • They aren't symlinks (I checked with the file-command).
    I only used the command macdeployqt MyProject.app -dmg

    Which strip-options should I use?

    I tried "strip -S QtCore" but the size didn't change at all.

  • I think there was a tool to strip unneeded architectures. "lipo"?

  • The libraries are already only for Intel x64 so lipo doesn't work here.

  • I usually customize my Qt libraries for deployment. Got it down to 8MB per platform without trying to hard. Still a lot of stuff in there that I don't need.

  • Can you provide a working qt config file?

  • Ugh, booting up my Mac (haven't done so for weeks;).

  • Note: This is meant to build Qt on Snow Leopard. Haven't tried it since 4.7.0.
    Have fun with it!


    #! /bin/sh


    export PATH=~/bin:$PATH # to use ccache

    rm -rf $QTDIR
    mkdir $QTDIR

    -arch 'ppc x86 x86_64' \

    cd $QTDIR
    make confclean
    export MAKEFLAGS=-j2
    printf "o\nyes\n" |
    -prefix $PWD
    -make 'libs' || exit 1
    make || exit 2
    cd ..

  • Thanks, I'll have to tweak it a bit but that will do.

    btw. qconfig is something different. You can exclude features in it like GUI-controls to further decrease the size but it's always a gample whether they'll compile.

  • These is the disk space used for the Qt libs in my application (i386 + ppc universal binaries):

    volker@macpro MyApp.app/Contents/Frameworks $ du -ms *.framework
    7 Qt3Support.framework
    6 QtCore.framework
    25 QtGui.framework
    3 QtNetwork.framework
    1 QtSql.framework
    1 QtSvg.framework
    54 QtWebKit.framework
    1 QtXml.framework
    15 QtXmlPatterns.framework
    1 phonon.framework

    I copy the files manually (using a homebrewn script, as macdeployqt was not available when I started development). All files exist only once, with a bunch of symlinks inside the bundle. I don't know if macdeployqt strips this out, but I remove all the header files from the frameworks, that save some bytes too.

    The configure options for unclewerner just strip down the build time of the Qt libs, as not all modules are built. QtCore, QtGui and all other modules that are built, will be the same size.

  • I have yet to find a fully compiling qconfig-file.

    The option -no-exceptions makes the libraries smaller though.

    macdeployqt strips the header-information out.

  • if I

    strip Contents/Frameworks/QtGui.framework/Versions/4/QtGui

    I get from 25 MB to 23 MB.

    I would not bet too much on qconfig, you will waste a lot of time for not very much saved space.

  • Yeah, you are right with that.

    Why is your QtGui 25MB anyways (mine is 12 MB) ? Is it the debug-version?

    OT: what's more important now is the problem I have with the desktop-components (http://developer.qt.nokia.com/forums/viewthread/6047). Will you look into it?

  • It has two architectures (i386 and ppc) in the universal binary. If I had x86_64 too, it would be roughly 36MB.

    I'll have a look into the components issue tomorrow, it's just too late now (1:30 in Berlin/Europe) and I need to go to bed :-)

  • Ah, at least I can exclude i386 and ppc here.

    Good night and thanks for all the help.
    This forum became quickly a new home for me.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.