diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fcf6661..ccc24c07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 2.6) project(otclient) +set(VERSION "0.5.3") + set(FRAMEWORK_SOUND ON) set(FRAMEWORK_GRAPHICS ON) set(FRAMEWORK_XML ON) @@ -28,6 +30,8 @@ if(WIN32) set(executable_SOURCES ${executable_SOURCES} otcicon.o) endif() +add_definitions(-D"VERSION=\\"${VERSION}\\"") + # add otclient executable add_executable(otclient ${framework_SOURCES} ${otclient_SOURCES} ${executable_SOURCES}) diff --git a/src/main.cpp b/src/main.cpp index 8c884051..dd9d0846 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,7 +32,7 @@ int main(int argc, const char* argv[]) // setup application name and version g_app.setName("OTClient"); g_app.setCompactName("otclient"); - g_app.setVersion("0.5.2_dev"); + g_app.setVersion(VERSION); // initialize application framework and otclient g_app.init(args); diff --git a/tools/make_snapshot.sh b/tools/make_snapshot.sh index dd345100..0a7b6890 100755 --- a/tools/make_snapshot.sh +++ b/tools/make_snapshot.sh @@ -33,6 +33,7 @@ fi cd $workdir/otclient revision=`git rev-list --all | wc -l` commit=`git describe --dirty --always` +version=`cat CMakeLists.txt | grep "set(VERSION" | sed 's/.*"\([^"]*\)".*/\1/'` # compile for win32 rm -rf build.win32 @@ -77,7 +78,7 @@ cd .. ################################################## # create win32 package -pkg_suffix="-snapshot-linux64-`date +%Y%m%d`" +pkg_suffix="-linux64-$version" pkgname="$name$pkg_suffix" pkgzip="$pkgname.tgz" cd $workdir @@ -125,7 +126,7 @@ cp $workdir/Tibia/*.dat $pkgname/modules/game_tibiafiles/860/ ################################################## # create win32 package -pkg_suffix="-snapshot-win32-`date +%Y%m%d`" +pkg_suffix="-win32-$version" pkgname="$name$pkg_suffix" pkgzip="$pkgname.zip" cd $workdir