How do I specify input the QMake INSTALLS variable?

Eirik M picture Eirik M · Feb 21, 2012 · Viewed 20.8k times · Source

In my Qt project I'm trying to copy libraries as part of the build process. The goal is to have a ready made distribution after the build with all necessary dynamic libraries.

This seems acheivable with the INSTALLS variable, but I find the documentation a bit thin: qmake Variable Reference: INSTALLS

In the example given:

  • Is target already defined, or is defined by writing target.path =?
  • Where is the documentation for possible members? .path and ...?

Answer

Dave Mateer picture Dave Mateer · Feb 21, 2012

Yeah, the docs have much to be desired here.

target is already defined, but that is a special case. You can define your own additional deployment sets. Here is how we specify the image format plugins:

imageformats.path = /opt/some/path/bin/imageformats
imageformats.files += $$[QT_INSTALL_DATA]/plugins/imageformats/*.so
INSTALLS += imageformats

Here is the minimal documentation about the three commands: http://doc.qt.io/qt-4.8/qmake-environment-reference.html#installs

yourset.path = /path/in/which/to/install/files
yourset.files = /files/to/install
yourset.extra = custom commands to run, eg. `touch somefile.txt`
INSTALLS += yourset