0

I want to include svn version number into my C/C++ code. I found a way to do it in linux, but I also compile the code under Windows, where I don't use svn.

One way to do it would be to create a file svn.h, which is then included into the code. The file should contain the following line:

#define SVNVERSION "12345M"

Here 12345M is the output of the command svnversion. How to create such a file using bash script (or how to include the command into the Makefile)?

2 Answers 2

0
echo '#define SVNVERSION "'$(svnversion .)'"' > svn.h

You may have to adjust svnversion . so it matches exactly what you write to get 12345M

0

AFAIR, SVN does keyword expansion, so you can get version numbers pasted in automatically on checkout.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .