diff --git a/CMakeLists.txt b/CMakeLists.txt index b1211955a..7e7311253 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,12 @@ else (MSVC) find_package (Curses) endif (MSVC) -find_package (SQLite3) -find_package (BerkeleyDB) +if (ERESSEA_DB STREQUAL "db") +find_package (BerkeleyDB REQUIRED QUIET) +else() +find_package (SQLite3 REQUIRED QUIET) +endif() + find_package (LibXml2 REQUIRED) find_package (ToLua REQUIRED) if (TOLUA_FOUND) diff --git a/res/core/de/strings.xml b/res/core/de/strings.xml index f773be014..6801cbb35 100644 --- a/res/core/de/strings.xml +++ b/res/core/de/strings.xml @@ -3703,7 +3703,7 @@ Aushorchen - sound_out + Sound out Kriegsgesang diff --git a/s/build b/s/build index e47ecf903..636777541 100755 --- a/s/build +++ b/s/build @@ -31,15 +31,18 @@ if [ ! -d $ROOT/$BUILD ]; then fi echo "build eressea" +CMAKE_ARGS=".." cd $ROOT/$BUILD BRANCH=$(git status -s -b | head -1 | cut -d\ -f 2 | sed 's/\..*//') if [ "$BRANCH" = "master" ] ; then VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//') echo "$BRANCH $VERSION" -cmake -DERESSEA_VERSION="$VERSION" .. +CMAKE_ARGS="-DERESSEA_VERSION=$VERSION ${CMAKE_ARGS}" else REV=$(git rev-parse --short HEAD) -cmake -DERESSEA_BUILDNO="$REV" .. +CMAKE_ARGS="-DERESSEA_BUILDNO=$REV $CMAKE_ARGS" fi + +cmake ${CMAKE_ARGS} make $MAKEOPTS && make test cd $OLDPWD diff --git a/s/cmake-init b/s/cmake-init index 3d4e073a7..7adbc9a0b 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -1,5 +1,20 @@ #!/bin/sh +ERESSEA_DB=sqlite +if [ -e /usr/include/db.h ] ; then +ERESSEA_DB=db +fi + +# Parse command line arguments +while [ ! -z "$1" ] ; do +if [ "$1" = "--with-db" ] ; then +ERESSEA_DB=db +elif [ "$1" = "--with-sqlite" ] ; then +ERESSEA_DB=sqlite +fi +shift 1 +done + ROOT=$(git rev-parse --show-toplevel) [ -z $BUILD ] && BUILD=Debug [ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" @@ -15,8 +30,6 @@ mkdir -p $BIN_DIR rm -f $BUILD ln -sf $BIN_DIR $BUILD -rm -f CMakeCache.txt - # use anything installed in /opt or /usr LIBRARY_PATH=/opt/lib:/opt/lib/$MACHINE:/usr/lib/$MACHINE INCLUDE_PATH=/opt/include:/usr/include @@ -30,11 +43,6 @@ if [ -d $HOME/usr ]; then fi DEST=$(dirname $ROOT)/server -ARGS=" -DCMAKE_BUILD_TYPE=$BUILD \ - -DCMAKE_LIBRARY_PATH=$LIBRARY_PATH \ - -DCMAKE_PREFIX_PATH=$PREFIX_PATH \ - -DCMAKE_INSTALL_PREFIX=$DEST" -# -DCMAKE_INCLUDE_PATH=$INCLUDE_PATH git submodule update --init @@ -46,7 +54,17 @@ elif [ -d /usr/local/include/lua5.1 ]; then LUA_DIR=/usr/local LUA_VERSION="5.1" fi -export LUA_DIR + +cat >| $BUILD/config.cmake <> $BUILD/config.cmake path="$(which tolua)" if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then @@ -59,7 +77,7 @@ if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then echo "building tolua..." cd tolua make - ARGS="$ARGS -DPC_TOLUA_DIR=$ROOT/tolua" + echo 'SET(PC_TOLUA_DIR "$ROOT/tolua" CACHE PATH "tolua root")' >> $BUILD/config.cmake else echo "tolua is $path" fi @@ -68,6 +86,6 @@ unset path set -e cd $BIN_DIR -cmake .. $ARGS $* +cmake -C config.cmake .. $* cd $OLDPWD