diff options
-rw-r--r-- | CMakeLists.txt | 15 | ||||
-rw-r--r-- | src/winver.h.in | 6 |
2 files changed, 20 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d9238d2..48e63788 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(MANA) -SET(VERSION 0.0.29.1) +IF (NOT VERSION) + SET(VERSION 0.1.0.0) +ENDIF() # where to look for cmake modules SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) @@ -16,6 +18,17 @@ IF (WIN32) SET(PKG_DATADIR ".") SET(PKG_BINDIR ".") SET(LOCALEDIR ".") + STRING(REPLACE "." " " _VERSION ${VERSION}) + SEPARATE_ARGUMENTS(_VERSION) + LIST(LENGTH _VERSION _LEN) + IF(NOT _LEN EQUAL 4) + MESSAGE(FATAL_ERROR "Version needs to be in the form MAJOR.MINOR.RELEASE.BUILD") + ENDIF() + LIST(GET _VERSION 0 VER_MAJOR) + LIST(GET _VERSION 1 VER_MINOR) + LIST(GET _VERSION 2 VER_RELEASE) + LIST(GET _VERSION 3 VER_BUILD) + CONFIGURE_FILE(src/winver.h.in src/winver.h) ELSE (WIN32) SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/mana) SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) diff --git a/src/winver.h.in b/src/winver.h.in new file mode 100644 index 00000000..fb0aac2c --- /dev/null +++ b/src/winver.h.in @@ -0,0 +1,6 @@ +/* VERSION DEFINITIONS */ +#define VER_MAJOR ${VER_MAJOR} +#define VER_MINOR ${VER_MINOR} +#define VER_RELEASE ${VER_RELEASE} +#define VER_BUILD ${VER_BUILD} +#define PACKAGE_VERSION "${VERSION}" |