Allow override of version number from build environment

This commit is contained in:
Andrew Nelless 2017-03-07 12:25:36 +00:00
parent c211184c23
commit 37b3f63690
2 changed files with 14 additions and 1 deletions

View File

@ -17,6 +17,19 @@
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
# Version number for Synergy # Version number for Synergy
if(DEFINED ENV{SYNERGY_VERSION_MAJOR})
set (VERSION_MAJOR $ENV{SYNERGY_VERSION_MAJOR})
set (VERSION_MINOR $ENV{SYNERGY_VERSION_MINOR})
set (VERSION_REV $ENV{SYNERGY_VERSION_PATCH})
set (VERSION_STAGE $ENV{SYNERGY_VERSION_STAGE})
else()
message (WARNING "Synergy version number not set in build environment. Defaulting")
set (VERSION_MAJOR 1)
set (VERSION_MINOR 9)
set (VERSION_REV 0)
set (VERSION_STAGE git)
endif()
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}")
set(SYNERGY_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") set(SYNERGY_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}")

View File

@ -4,4 +4,4 @@
SYNERGY_VERSION_MAJOR = 1 SYNERGY_VERSION_MAJOR = 1
SYNERGY_VERSION_MINOR = 9 SYNERGY_VERSION_MINOR = 9
SYNERGY_VERSION_PATCH = 0 SYNERGY_VERSION_PATCH = 0
SYNERGY_VERSION_LABEL = git SYNERGY_VERSION_STAGE = git