PDA

View Full Version : qmake INSTALLS variable not working as expected



andy.fillebrown
9th November 2010, 02:13
When I add a file to the INSTALLS variable, qmake doesn't put it in the makefile unless the file exists. Is there a way to get a file added to the INSTALLS variable that doesn't exist before qmake is run on the project file?

Cheers,
~ andy.f

tbscope
9th November 2010, 04:27
Do you want to install generated files?

Use PRE_TARGETDEPS to achieve this. See for example: http://qt.gitorious.org/qt-creator/qt-creator/blobs/master/src/qtcreatorplugin.pri

Qt Creator does something similar for pluginspec files.

andy.fillebrown
9th November 2010, 13:58
Thanks! ...but wouldn't it be easier to be able to add the file to the INSTALLS variable before the file exists? All that extra compiler stuff seems like overkill for something so simple.

Cheers,
~ andy.f

wysota
9th November 2010, 15:02
When I add a file to the INSTALLS variable, qmake doesn't put it in the makefile unless the file exists. Is there a way to get a file added to the INSTALLS variable that doesn't exist before qmake is run on the project file?
As far as I remember you need to add no_path or something similar to the target configuration and use the simplified installation method (where you use the .commands subvariable) but in general how qmake installation works is that the file should exist at the time of makefile generation.


but wouldn't it be easier to be able to add the file to the INSTALLS variable before the file exists?
Well, it depends. Usually you don't want to receive messages that files don't exist during installation as you'd think the compilation process might have failed and you don't want to install files that shouldn't be installed (i.e. when using wildcards in files to copy, you couldn't almost ever use "*" as the file pattern as it would copy stuff such as Makefile too).

andy.fillebrown
9th November 2010, 16:04
Thanks! Searching through the qmake source on "no_path" I discovered the "no_check_exist" .CONFIG flag. This is exactly what I was looking for. I realize it may not be portable for non-makefile project files, but I'm not really concerned about that, yet.

Cheers,
~ andy.f