[Qt-interest] QMake hack to create compile-tme 'build version' string

Syam Krishnan syamcr at gmail.com
Wed Oct 19 15:01:07 CEST 2011


On 10/18/2011 01:49 PM, Manner Robert wrote:
>
> You can also use something like:
>
> VERSION = $$system(date "+%Y%m%d%H%M")
> DEFINES += VERSION=\\\"\"$$VERSION\"\\\"
> message ("Version:" $$VERSION)
There's one problem with this method. Since it's a macro, it will be 
reflected only if I re-compile the file that uses it (or I do a complete 
rebuild of the project). If I change some other source file and build 
the application, the unchanged object files will all have the previous 
value of the macro.

regards,

Syam



More information about the Qt-interest-old mailing list