set version based on most recent tag

This commit is contained in:
Enno Rehling 2016-09-10 18:44:08 +02:00
parent 7807f83830
commit 497f53102c
2 changed files with 6 additions and 0 deletions

View file

@ -42,5 +42,7 @@ fi
echo "build eressea"
cd $ROOT/$BUILD
VERSION=$(git describe --tags)
cmake -DERESSEA_VERSION="$VERSION" ..
make $MAKEOPTS && make test
cd $OLDPWD

View file

@ -12,6 +12,10 @@ include_directories (${TOLUA_INCLUDE_DIR})
include_directories (${BSON_INCLUDE_DIR})
include_directories (${INIPARSER_INCLUDE_DIR})
IF(DEFINED ERESSEA_VERSION)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DERESSEA_VERSION=\\\"${ERESSEA_VERSION}\\\"")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wno-sign-conversion")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")