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

Bill Crocker william.crocker at analog.com
Mon Oct 17 19:14:34 CEST 2011


Syam Krishnan wrote:
> On 10/17/2011 07:08 PM, Bill Crocker wrote:
>> I use the QMAKE_PRE_LINK and QMAKE_POST_LINK options to do this.
> 
> Thanks for that pointer. But won't it be too late if we do it just 
> before linking? I mean, the object files would've been already created, 
> right?
>

My QMAKE_PRE_LINK activity consists of creating one more .o
file which becomes part of the link.

    QMAKE_PRE_LINK = make link_time
    LIBS          += link_time.o

And then in my makefile:

    link_time : always
         echo "int link_time() { return `date +%s`; }" > link_time.cc;
         gcc -c ${CCFLAGS} link_time.cc

> regards,
> 
> Syam
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
> 





More information about the Qt-interest-old mailing list