*add* include svn revision in the VERSION_STRING if building with cmake

git-svn-id: http://tint2.googlecode.com/svn/trunk@475 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
Andreas.Fink85
2010-06-09 15:31:18 +00:00
parent f8889fdbe0
commit abeb6d384d
5 changed files with 41 additions and 5 deletions

28
get_svnrev.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
FALLBACK="0.10-svn"
if [[ $# -eq 0 ]]; then
DIR=.
else
DIR=$1
fi
if [[ -f version.h ]]; then
REV_OLD=$(cat version.h | cut -d" " -f3)
else
REV_OLD=""
fi
if [[ -x "$(which svnversion 2>/dev/null)" && -d "${DIR}/.svn" ]] ; then
REV=\"$(svnversion -n ${DIR})\"
else
REV=${FALLBACK}
fi
if [[ ${REV_OLD} != ${REV} ]]; then
echo "Building new version.h"
echo "#define VERSION_STRING "${REV}"" > version.h
fi