[Interest] compile SVN-Version into Project with qmake

thomas vincent vrince at gmail.com
Mon Feb 13 15:11:45 CET 2012


Hi,
Personally on Linux I use :

SVNVERSION = $$system("svn info ../ | grep Revision | tr -d 'Revison: '")
system( "echo 'const std::string svn_version = \"$$SVNVERSION\";'" >
../version.h)

Then you can include the "version.h" file when you need to use the
current SVN revision.
This gives a clean number (no letter and or working copy pre-commit
revision ...).

I guess you can pass it to GCC from there ;).

Tom

2012/2/8 André Pönitz <andre.poenitz at mathematik.tu-chemnitz.de>:
> On Wed, Feb 08, 2012 at 08:09:19PM +0100, Philipp Menke wrote:
>> Hi,
>> I would like to compile the current Revision of my repository into my
>> code. How could I manage this with qmake?
>>
>> I think one could use "svn info | grep Revision" or sth like that to get
>> the current Revision number and pass this as a preprocessor-Define into
>> gcc.
>> But how could I have this been done automatically?
>>
>> Do you have any idea how to realise?
>
> Looks like the the problem came up before, see
>
>  http://lists.trolltech.com/qt-interest/2006-10/msg00596.html
>
> Seems to be also discussed on
>
>  http://colby.id.au/node/145
>  http://stackoverflow.com/questions/5083441/how-to-add-pre-build-step-in-qmake-qtcreator
>  http://qtcreator.blogspot.com/2009/10/generating-automatic-version-numbers.html
>
> etc
>
> Andre'
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list