[Qt-interest] QMake pre-build step?

Konrad Rosenbaum konrad at silmor.de
Thu Jul 30 14:58:20 CEST 2009


On Thursday 30 July 2009, Robert Caldecott wrote:
> I think I am out of luck, but here goes...
>
> Is there any way to add a 'pre-build' step to a .pro file so you can
> execute a target _every_ time a project is built?  I already use the
> QMAKE_POST_LINK command to run unit tests after linking, but I have a
> script that generates my project's version number and I need to run it
> every time I make the project - even if none of the project's .cpp/.h
> files have changed...
>
> Can this be done?  If not, is is likely to be a planned addition to
> qmake?

see PRE_TARGETDEPS QMAKE_EXTRA_TARGETS

You can specify custom build steps, eg. this would call makemyversion.sh to 
create myversion.cpp every time before it builds something:

versiontarget.target = myversion.cpp
versiontarget.commands = ./makemyversion.sh
versiontarget.depends = FORCE

PRE_TARGETDEPS += myversion.cpp
QMAKE_EXTRA_TARGETS += versiontarget



	Konrad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090730/8e2e1ef5/attachment.bin 


More information about the Qt-interest-old mailing list