Add support for BUILDS_TODAY to CMake

This commit is contained in:
Andrew Nelless 2017-05-22 11:09:58 +01:00 committed by GitHub
parent 0f137543e4
commit e041af6010
1 changed files with 8 additions and 2 deletions

View File

@ -91,8 +91,14 @@ endif()
#endif()
string (TIMESTAMP SYNERGY_BUILD_DATE "%Y%m%d" UTC)
if (DEFINED ENV{BUILDS_TODAY})
set (SYNERGY_BUILDS_TODAY $ENV{BUILDS_TODAY})
else()
set (SYNERGY_BUILDS_TODAY 1)
endif()
if (DEFINED ENV{BUILD_NUMBER})
set (SYNERGY_BUILD_NUMBER $ENV{BUILD_NUMBER}})
set (SYNERGY_BUILD_NUMBER $ENV{BUILD_NUMBER})
else()
set (SYNERGY_BUILD_NUMBER 1)
endif()
@ -101,7 +107,7 @@ set (SYNERGY_VERSION "${SYNERGY_VERSION_MAJOR}.${SYNERGY_VERSION_MINOR}.${SYNERG
set (SYNERGY_SNAPSHOT_INFO "${SYNERGY_BUILD_DATE}.${SYNERGY_REVISION}")
if (SYNERGY_VERSION_STAGE STREQUAL "git")
set (SYNERGY_VERSION_TAG "b${SYNERGY_BUILD_NUMBER}.${SYNERGY_SNAPSHOT_INFO}")
set (SYNERGY_VERSION_TAG "${SYNERGY_SNAPSHOT_INFO}")
else()
set (SYNERGY_VERSION_TAG "${SYNERGY_VERSION_STAGE}")
endif()