[cmake-developers] Qt Bundle Utilities/Packaging

Mike McQuaid mike at mikemcquaid.com
Wed Apr 20 07:18:41 EDT 2011


On 7 April 2011 18:17, Clinton Stimpson <clinton at elemtech.com> wrote:
> I think you should *always* write out a qt.conf file.
> The Qt libraries have hardcoded paths (used if there is no qt.conf file) and if
> the target machine has a Qt installation at the same location as the build
> machine, it could get the target machines plugins instead.  These plugins are
> tied to a specific version and configuration of Qt, so they cannot be mixed.  On
> Mac, the problem of a missing qt.conf is immediate on the build machine.

In my experience this isn't needed on Mac and can/should instead be
set by calling QApplication::setLibraryPaths or embedding qt.conf as a
resource on Windows or Linux. I think on both of those platforms it's
fairly unpleasant to just have a plain-text qt.conf file sitting in
your binary directory.

> I think we should add QT_LIBRARY_DIR to fixup_bundle()'s dirs all the time.

This isn't always necessary and is hard to get at install time. My
solution still allows this to be done optionally if it can't be found.

> Have you thought about letting the user supply a list of their own plugins and
> having the function add the default Qt plugins to that list (or a set of
> plugins based on the QT_USE_* variables)?

I'd rather install only the minimal amount of plugins rather than
automatically install them all. Most applications using e.g. QtSQL
will only use a single plugin, not multiple.

> Also, one frequent complaint with using these functions is the user having to
> do
> install(CODE ".... ") and worry about escaping quotes and dollar signs.
> Do you think this would be a good time to address that?

Have added a "install_qt4_app" which should deal with this.

Patch attached for something actually tested and working for two
internal projects.

-- 
Mike McQuaid
http://mikemcquaid.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-DeployQt4-module.patch
Type: application/octet-stream
Size: 4726 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20110420/691f8d85/attachment-0002.obj>


More information about the cmake-developers mailing list