Commit 3834b449 authored by callum_linden's avatar callum_linden

Vendor source drop - Dullahan version build number now based on time of build automatically

--HG--
branch : vendor
parent 885bb284
......@@ -148,16 +148,27 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
################################################################################
## parse CEF version header and process into dullahan header
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CEF_VERSION_STR REGEX "\#define CEF_VERSION ")
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CHROME_VERSION_MAJOR_STR REGEX "\#define CHROME_VERSION_MAJOR ")
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CHROME_VERSION_MINOR_STR REGEX "\#define CHROME_VERSION_MINOR ")
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CHROME_VERSION_BUILD_STR REGEX "\#define CHROME_VERSION_BUILD ")
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CHROME_VERSION_PATCH_STR REGEX "\#define CHROME_VERSION_PATCH ")
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/src/dullahan_version.h.in"
"${PROJECT_SOURCE_DIR}/src/dullahan_version.h"
)
## Parse CEF version header and process into dullahan header.
## Only do this if it's a clean build (try to keep version/build number
## the same for the same set of source files)
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/src/dullahan_version.h")
# Extract CEF/Chrome version info from CEF header
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CEF_VERSION_STR REGEX "\#define CEF_VERSION ")
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CHROME_VERSION_MAJOR_STR REGEX "\#define CHROME_VERSION_MAJOR ")
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CHROME_VERSION_MINOR_STR REGEX "\#define CHROME_VERSION_MINOR ")
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CHROME_VERSION_BUILD_STR REGEX "\#define CHROME_VERSION_BUILD ")
FILE(STRINGS ${CEF_INCLUDE_DIR}/cef_version.h CHROME_VERSION_PATCH_STR REGEX "\#define CHROME_VERSION_PATCH ")
# Create a build number based on the actual build date/time
string(TIMESTAMP BUILDNUMBER "#define DULLAHAN_VERSION_BUILD %Y%m%d%H%M")
# Parse the version input file into the Dullahan version header
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/src/dullahan_version.h.in"
"${PROJECT_SOURCE_DIR}/src/dullahan_version.h"
)
endif ()
################################################################################
## dullahan host executable
......
......@@ -39,10 +39,14 @@
#define DULLAHAN_VERSION_MAJOR 1
#define DULLAHAN_VERSION_MINOR 2
// The build version number as of v1.2 is the number of "10 minutes since 2000-01-01"
// Still not sure if this is a good idea but it was better than a value selected
// randomly when the version needed to be bumped. To be continued...
#define DULLAHAN_VERSION_BUILD 1022544
// The build version number as of v1.2 is now the date/time the build was made
// It is only regenerated if the constructed version header (dullahan_version.h)
// is not present when the Cmake script is executed. Not perfect - one can still
// have different build numbers for same set of source files - but it thankfully
// removed the requirement to remember to change the version/build number each
// time a change is made to the Dullahan source (which was often missed).
// Credit for suggestion to Henri Beauchamp
@BUILDNUMBER@
// version numbers pulled from CEF build via Cmake
@CEF_VERSION_STR@
......
python -c "import datetime; print int((datetime.date.today() - datetime.date(2000, 1, 1)).total_seconds() / 3660.0)"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment