diff --git a/CMakeLists.txt b/CMakeLists.txt index d0dcb49..e37541e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,8 @@ endif(${CMAKE_VERSION} STREQUAL "2.8.2") project(voxelands) # Also remember to set PROTOCOL_VERSION in clientserver.h when releasing -set(VERSION_MAJOR 1608) -set(VERSION_MINOR 00) -set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}${VERSION_EXTRA}") +set(VERSION_STRING "") +execute_process(COMMAND git log -1 --date=short --format='%cd-%h' OUTPUT_VARIABLE VERSION_STRING) MESSAGE(STATUS "*** Will build version ${VERSION_STRING} ***") @@ -119,9 +118,7 @@ add_subdirectory(src) # CPack set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Fun-Focused Free Software Voxel World Game") -set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) +set(CPACK_PACKAGE_VERSION_STRING ${VERSION_STRING}) set(CPACK_PACKAGE_VENDOR "darkrose") set(CPACK_PACKAGE_CONTACT "Lisa 'darkrose' Milne ")