[SOLVED] Automatically increment a build number
I need to display the version of the software I am building. It will have the following nomenclature: majorVersion.MinorVersion.BuildNumber
Any ideas on how I can increment a build number each time I build and how I can access this value from the program at run time?
3 replies
you can have a look at this gitorious project: auto incr build nr [gitorious.org] and at this [gitorious.org] pro file, the tool is used there.
I ended up adding these lines to the .pro file:
QMAKE_EXTRA_TARGETS += buildNo
buildNo.commands = ./buildNoScript
PRE_TARGETDEPS += buildNo # adding this removes the necessity to use .target
Then I made a simple script called buildNoScript that calls a small program that updates build info in a file (it reads the build no from that file first then increments it and writes it back).
You must log in to post a reply. Not a member yet? Register here!


