PDA

View Full Version : Custom action added to make by qmake



NTwoO
20th February 2007, 14:14
Hi all,

I am adding automatic versioning to my application. I already have the shell scripts to change the v.w.x.y format version number in my sourcecode and change the compile timestamp. I can include this in my makefile, to handle this in my build. Unfortunately qmake will nuke my changes if run again (I touch my .pro file). How can I add custom shell commands to certain make rules?

wysota
20th February 2007, 14:39
http://wiki.qtcentre.org/index.php?title=Undocumented_qmake#Custom_tools

You are aware that qmake supports versioning, right? There is a VERSION variable and you can add a DEFINES += VER="${VERSION}" (or something like that) to the project file so that the VER macro expands to the version number in your application.

NTwoO
2nd March 2007, 11:17
Oh, I fixed my problem by simply using 2 makefiles. One called makefile and the qmake is generated as Makefile. gnu make executes makefile and that subsequently executes Makefile.

A bit of a hack, but it woks :)