#6332 Make version number easier to update in Version.cmake

This commit is contained in:
Nick Bolton 2018-07-04 16:21:56 +01:00
parent 9b4d14e085
commit 1b0ab12c91
1 changed files with 18 additions and 25 deletions

View File

@ -3,37 +3,30 @@ cmake_minimum_required (VERSION 3.4)
#
# Synergy Version
#
if (NOT DEFINED SYNERGY_VERSION_MAJOR)
if (DEFINED ENV{SYNERGY_VERSION_MAJOR})
set (SYNERGY_VERSION_MAJOR $ENV{SYNERGY_VERSION_MAJOR})
else()
set (SYNERGY_VERSION_MAJOR 1)
endif()
set (SYNERGY_VERSION_MAJOR 1)
set (SYNERGY_VERSION_MINOR 10)
set (SYNERGY_VERSION_PATCH 0)
set (SYNERGY_VERSION_STAGE "snapshot")
#
# Version from CI
#
if (DEFINED ENV{SYNERGY_VERSION_MAJOR})
set (SYNERGY_VERSION_MAJOR $ENV{SYNERGY_VERSION_MAJOR})
endif()
if (NOT DEFINED SYNERGY_VERSION_MINOR)
if (DEFINED ENV{SYNERGY_VERSION_MINOR})
set (SYNERGY_VERSION_MINOR $ENV{SYNERGY_VERSION_MINOR})
else()
set (SYNERGY_VERSION_MINOR 10)
endif()
if (DEFINED ENV{SYNERGY_VERSION_MINOR})
set (SYNERGY_VERSION_MINOR $ENV{SYNERGY_VERSION_MINOR})
endif()
if (NOT DEFINED SYNERGY_VERSION_PATCH)
if (DEFINED ENV{SYNERGY_VERSION_PATCH})
set (SYNERGY_VERSION_PATCH $ENV{SYNERGY_VERSION_PATCH})
else()
set (SYNERGY_VERSION_PATCH 0)
message (WARNING "Synergy version wasn't set. Set to ${SYNERGY_VERSION_MAJOR}.${SYNERGY_VERSION_MINOR}.${SYNERGY_VERSION_PATCH}")
endif()
if (DEFINED ENV{SYNERGY_VERSION_PATCH})
set (SYNERGY_VERSION_PATCH $ENV{SYNERGY_VERSION_PATCH})
endif()
if (NOT DEFINED SYNERGY_VERSION_STAGE)
if (DEFINED ENV{SYNERGY_VERSION_STAGE})
set (SYNERGY_VERSION_STAGE $ENV{SYNERGY_VERSION_STAGE})
else()
set (SYNERGY_VERSION_STAGE "snapshot")
endif()
if (DEFINED ENV{SYNERGY_VERSION_STAGE})
set (SYNERGY_VERSION_STAGE $ENV{SYNERGY_VERSION_STAGE})
endif()
if (NOT DEFINED SYNERGY_REVISION)