I needed to define a constant to give me the SVN version of a project. I added the following line to Compiler settings > Other Options:
\'-DSVN_VER=\"`svnversion`\"\'
The problem is once CB generates compiler command with all the switches and the expansion of svnversion command it reuses the same command string for the following compilations and SVN_REV never redefined (clean, rebuild don't help) until I close and open CB again.
I want \'-DSVN_VER=\"`svnversion`\"\'
to be shell-expanded every time I build. Is it possible?
Thanks.
Hi jackhab,
I do not know if I understand exactly your problem. Your could define a pre build step to get the SVN revision
svn --xml info <your file name>
The resulting output could be parsed by simple grep and sed script and then this information could be redirected in to a header file, which sets the Define SVN_VER
You need something like this:
/*
* This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
* http://www.gnu.org/licenses/lgpl-3.0.html
*
* $Revision: 4909 $
* $Id: annoyingdialog.cpp 4909 2008-02-27 13:15:26Z mortenmacfly $
* $HeadURL: svn://svn.berlios.de/codeblocks/branches/wxpropgrid_debugger/src/sdk/annoyingdialog.cpp $
*/
?
Read the svn book I think it is called annotations or something like that.... never used them and never will
Why someone would use them?
It make diff-ing a svn tree and a separate non-svn tree (a tree in git-svn for example) impossible.