[Development] Qt 4.x and Qt 5 frameworks should use @rpath (QTBUG-31814)
Jake Petroules
jake.petroules at petroules.com
Fri Aug 8 04:04:39 CEST 2014
Expanding on my previous benchmarks regarding embedding libraries in app bundles, see the following script... on my old, slow machine I've observed it completing in < 10 seconds to copy both debug and release versions of the libraries listed below. Only two processes need to be forked, too. One instance of rsync for libraries/frameworks and another instance for plugins.
Incremental builds (the more important part) are virtually instantaneous (< 100 ms).
Might be worth it to consider using rsync to implement this in qmake/qbs. Ossi mentioned QMAKE_BUNDLE_DATA but I'm not sure if there's a good way to exclude headers and such using that. Might be worth it to have a dedicated variable for bundled libraries (and plugins?), plus we get rsync's performance optimizations. Then we don't need macdeployqt, or at least most of it. :)
#!/bin/sh
if [ "$1" != "debug" ] ; then
DEBUG=--exclude\ '*_debug'
fi
if [ -z "$QT_INSTALL_LIBS" ] ; then
QT_INSTALL_LIBS=/Library/Frameworks
fi
# rsync is sensitive to trailing slashes
# the source directories MUST have them
rsync -a \
--exclude '.DS_Store' \
--exclude 'Headers' \
--exclude '*.prl' \
--exclude '*.dSYM' \
$DEBUG \
$QT_INSTALL_LIBS/QtCore.framework \
$QT_INSTALL_LIBS/QtGui.framework \
$QT_INSTALL_LIBS/QtNetwork.framework \
$QT_INSTALL_LIBS/QtOpenGL.framework \
$QT_INSTALL_LIBS/QtSql.framework \
$QT_INSTALL_LIBS/QtSvg.framework \
$QT_INSTALL_LIBS/QtWebKit.framework \
$QT_INSTALL_LIBS/QtXml.framework \
$PWD
--
Jake Petroules - jake.petroules at petroules.com
Chief Technology Officer - Petroules Corporation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140807/c019eea7/attachment.html>
More information about the Development
mailing list