PDA

View Full Version : How to specify qmake-generated target in a platform independent way



dvolosnykh
9th March 2013, 07:07
qmake's TARGET variable is used to specify base name of the generated target. But the final filename is composed by qmake depending on the host OS rules.

Regarding


TEMPLATE = lib
TARGET = test
it turns out to be test.dll and libtest.so for Windows and Linux respectively.

When setting up installation rules, I'd like to refer the target by its final filename rather then messing up the configuration with platform prefixes like win32 or unix.


target.path = $$DEPLOY_DIR
target.files = <target filename here>
INSTALLS += target
There's the same named TARGET variable in generated Makefile, but it is impossible to use it directly in target.files.

wysota
9th March 2013, 09:04
With TARGET you don't need to set target.files -- it will be filled by qmake automatically.