[CMake] new support for deploying Qt apps

Clinton Stimpson clinton at elemtech.com
Sat Jan 1 20:39:08 EST 2011


There has been recent discussions about deploying Qt applications, 
especially about Qt plugins.  To address that issue, some new support 
has been added for plugins to FindQt4.cmake and I would enjoy feedback 
from any testers.

Specifically:
- support for static plugins
If you are using a static build of Qt, and your code has 
Q_IMPORT_PLUGIN() calls. You now have find_library() calls done for you 
to link with those static Qt plugins.  For example, you can use 
QT_QGIF_LIBRARY to link with the qgif static plugin.

- support for dynamic plugins
Some find_library() calls are done for these plugins, but people may 
generally not use these new variables.  Instead some new functions are 
added: qt4_deploy_plugin(), qt4_deploy_plugin_group(), 
qt4_deploy_default_plugins().

You may use it like so:
include(CPack)
install(TARGETS testqt DESTINATION bin)
qt4_deploy_default_plugins(bin/plugins)
.... other install stuff for bundle utilities.

Now, if the BundleUtilities stuff could be simpler somehow...

Thanks,
Clint



More information about the CMake mailing list