From 004d9ec4c850f7c28622982c43520b0ef810e169 Mon Sep 17 00:00:00 2001 From: Peinthor Rene Date: Fri, 10 Apr 2015 10:25:25 +0200 Subject: [PATCH] cmake: remove the gen_version.h generation to have the git hash in the dev build didn't really bring any advantage, but make the build scripts more complicated --- CMakeLists.txt | 29 ++--------------------------- src/gen_version.h | 11 +++++++---- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a776d4a9..8cdedc84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,31 +139,6 @@ else() endif(SQLB_TSS) endif() -set(gv "${CMAKE_SOURCE_DIR}/src/gen_version.h") - -# get git version hash -if(EXISTS "${CMAKE_SOURCE_DIR}/.git") - add_custom_command(OUTPUT "${gv}" - COMMAND echo "#ifndef GEN_VERSION_H" > "${gv}" - COMMAND echo "#define GEN_VERSION_H" >> "${gv}" - COMMAND git log -n1 "--format=#define APP_VERSION \"%h_git\"" >> "${gv}" - COMMAND echo "#define MAJOR_VERSION 999" >> "${gv}" - COMMAND echo "#define MINOR_VERSION 0" >> "${gv}" - COMMAND echo "#define PATCH_VERSION 0" >> "${gv}" - COMMAND echo "#endif" >> "${gv}" - DEPENDS .git/HEAD - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - VERBATIM) -else() - file(WRITE "${gv}" - "#ifndef GEN_VERSION_H\n" - "#define GEN_VERSION_H\n" - "#define APP_VERSION \"999.0.0\"\n" - "#define MAJOR_VERSION 999\n" - "#define MINOR_VERSION 0\n" - "#define PATCH_VERSION 0\n" - "#endif\n") -endif() #icon and correct libs/subsystem for windows if(WIN32) @@ -263,8 +238,8 @@ set(CPACK_PACKAGE_VENDOR "oldsch00l") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_PACKAGE_VERSION_MAJOR "3") -set(CPACK_PACKAGE_VERSION_MINOR "0") -set(CPACK_PACKAGE_VERSION_PATCH "0") +set(CPACK_PACKAGE_VERSION_MINOR "5") +set(CPACK_PACKAGE_VERSION_PATCH "99") set(CPACK_PACKAGE_INSTALL_DIRECTORY "SqliteBrowser${CPACK_PACKAGE_VERSION_MAJOR}") if(WIN32 AND NOT UNIX) # There is a bug in NSI that does not handle full unix paths properly. Make diff --git a/src/gen_version.h b/src/gen_version.h index a906a569..295fc164 100644 --- a/src/gen_version.h +++ b/src/gen_version.h @@ -1,7 +1,10 @@ #ifndef GEN_VERSION_H #define GEN_VERSION_H -#define APP_VERSION "master_git" -#define MAJOR_VERSION 999 -#define MINOR_VERSION 0 -#define PATCH_VERSION 0 +#define MAJOR_VERSION 3 +#define MINOR_VERSION 5 +#define PATCH_VERSION 99 + +#define str(s) #s +#define xstr(s) str(s) +#define APP_VERSION xstr(MAJOR_VERSION) "." xstr(MINOR_VERSION) "." xstr(PATCH_VERSION) #endif