Add build version to the nightly builds (#1390)

Make the Windows nightly build versioning information meaningful. ;)
This commit is contained in:
Karim ElDeeb
2018-05-20 14:54:24 +02:00
committed by Justin Clift
parent 4ab2bee2ac
commit b69e7cd034
3 changed files with 20 additions and 3 deletions

View File

@@ -1,5 +1,16 @@
project(sqlitebrowser)
cmake_minimum_required(VERSION 2.8.7)
cmake_minimum_required(VERSION 2.8.11)
# BUILD_VERSION is the current date in YYYYMMDD format. It is only
# used by the nightly version to add the date of the build.
string(TIMESTAMP BUILD_VERSION "%Y%m%d")
# Choose between building a stable version or nightly (the default), depending
# on whether '-DBUILD_STABLE_VERSION=1' is passed on the command line or not.
option(BUILD_STABLE_VERSION "Don't build the stable version by default" OFF)
if(NOT BUILD_STABLE_VERSION)
add_definitions(-DBUILD_VERSION=${BUILD_VERSION})
endif()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")

View File

@@ -7,4 +7,10 @@
#define str(s) #s
#define xstr(s) str(s)
#define APP_VERSION xstr(MAJOR_VERSION) "." xstr(MINOR_VERSION) "." xstr(PATCH_VERSION)
// If it is defined by the compiler, then it is a nightly build, and in the YYYYMMDD format.
#ifndef BUILD_VERSION
#define BUILD_VERSION 0
#endif
#endif

View File

@@ -11,8 +11,8 @@ BEGIN
BEGIN
BLOCK "000004B0"
BEGIN
VALUE "FileVersion", APP_VERSION
VALUE "ProductVersion", APP_VERSION
VALUE "FileVersion", APP_VERSION "." xstr(BUILD_VERSION)
VALUE "ProductVersion", APP_VERSION "." xstr(BUILD_VERSION)
VALUE "FileDescription", "DB Browser for SQLite"
VALUE "ProductName", "DB Browser for SQLite"
VALUE "InternalName", "DB Browser for SQLite"