[CMake] DeployQt4 and make package

Daniel Franke franke.daniel at gmail.com
Fri Apr 13 14:21:39 EDT 2012


Hi all.

I try to use DeployQt4(fixup_qt4_executable) to build a zip/nsis package that 
includes all the dependencies of the executable. After some struggling I got 
this working for `make install`, but `make package` still eludes me.

Consider:
  include (GNUInstallDirs)
  set (PREFIX $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})
  file (GLOB PLUGINS "${QT_PLUGINS_DIR}/imageformats/*.dll")
  install (CODE "include(DeployQt4)
                 FIXUP_QT4_EXECUTABLE (\"${PREFIX}/${ARGV0}.exe\"
                                       \"${PLUGINS}\"
                                       \"\"
                                       \"${PREFIX}\"
                                       \"${PREFIX}/plugins\")")

This installs the dependencies is in the install location. Ok. But how do I 
need to change this so that PREFIX points to the correct path in 
_CPackPackages/.../bin as one has to pass the actual location of the binary?

There is the CPACK_PACKAGE_INSTALL_DIRECTORY, but it seems undefined if I add:

  message(\"\${CPACK_PACKAGE_INSTALL_DIRECTORY}\")

to above code piece. Could somebody kindly point out how to get this to work?

Thanks

	Daniel



More information about the CMake mailing list