[Interest] QMake commands, QML preprocessing
annulen at yandex.ru
Mon Feb 13 15:55:03 CET 2012
13.02.2012, 18:19, "Harri Pasanen" <harri at mpaja.com>:
> I'm wondering what would be the recommended way to pre-process QML?
> # Add more folders to ship with the application, here
> folder_01.source = qml/n9test
> folder_01.target = qml
> DEPLOYMENTFOLDERS = folder_01
> At deployment time I'd like to change the QML, but keep the unchanged copy
> in version control.
> There are some hooks for adding preprocessing for C++, but does
> something equivalent exist for QML?
> In this particular case I would like to have VERSION variable as
> a macro inside QML, so that it would automatically expand to the same
> as defined in .pro, rather than having to edit in manually.
You need to use QMAKE_SUBSTITUTES. Example:
TARGET = app
FOO = bar
QMAKE_SUBSTITUTES += test.in
Running qmake produces file "test" containing "bar".
More information about the Interest