[cmake-developers] Qt Bundle Utilities/Packaging

Clinton Stimpson clinton at elemtech.com
Thu Apr 7 11:41:07 EDT 2011


On Thursday, April 07, 2011 09:07:32 am Mike McQuaid wrote:
> Hey,
> 
> I've ended up with several Qt projects with nearly identical packaging
> requirements (i.e. use BundleUtilties, install plugins by group, write
> qt.conf, etc.). As a result, I'm going to work on some functions to
> make this process easier (I already have it working for several
> projects, just need to make it more generic).
> 
> Would this be a mergeable addition? Should I add this to
> BundleUtilties, FindQt4, UseQt4 or a new module (DeployQt4)?
> 
> Thanks!

I would put it in Qt4Macros.cmake and document it in FindQt4.cmake.

I would love some other people's input in this work.
I have put some work into it already and can give you the patches I have so 
far.
When I started 'using' the functions, they didn't work the way I wanted.  So 
what I am hoping for was input on what the CMakeLists.txt files should 
contain... then maybe we can adjust the functions for installing Qt plugins to 
work with that.

Here's a snippet from a CMakeLists.txt file that demonstrates how I wanted to 
be able to call it.  You'll notice how the functions follow the install() 
command style.  There is some of passing the same arguments into each command, 
but at least the caller doesn't have to formulate a different set of arguments 
for each function call.  If there is a totally different way to think about 
this, I'm open to suggestions.

===========
function(install_prerequisites  ....)
  install(CODE "
  include(BundleUtilities)
  ....
  fixup_bundle(\"${app}\" \"${libs}\" \"${dirs}\")
  "
  )
endfunction(install_prerequisites)

include(CPack)
# install target
install(TARGETS testqt DESTINATION bin)
# install Qt plugins in a custom location
qt4_install_default_plugins(DESTINATION bin/myplugins)
# install qt.conf file with custom plugin location
qt4_install_qtconf(DESTINATION bin BUNDLE_DESTIATION . CONTENTS Plugins 
myplugins)
# install prerequisites  (todo, how to pass installed Qt plugins into this 
function?)
install_prerequisites(TARGET testqt DESTINATION bin BUNDLE_DESTINATION . 
COMPONENT Runtime)
===========

Also, see attached for patch to Qt4Macros.cmake and FindQt4.cmake.

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt4-install.patch
Type: text/x-patch
Size: 4778 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20110407/24d5e048/attachment-0002.bin>


More information about the cmake-developers mailing list