If you were to pass the version information as an included file (let's say "version.h") instead of a #define, then you could add the following to your qmake file
The first 3 lines tell how to make a new target object called "version" that generates "version.h". It is made by executing the commands "". The target is dependent on ".git" The "QMAKE_EXTRA_TARGETS" says there is a new target known as "version". The "PRE_TARGETDEPS" indicates that "version.h" needs to exist before anything else can be done (which forces it to be made if it isn't already made). |
|