Update version number logic

This commit is contained in:
Andrew Nelless 2017-03-09 18:50:02 +00:00
parent fedbcb0f3a
commit 6b3600ece0
1 changed files with 12 additions and 6 deletions

View File

@ -25,12 +25,18 @@ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
# #
# Version # Version
# #
# TODO: Eliminate variables not prefixed with SYNERGY_ if ((NOT DEFINED SYNERGY_VERSION_MAJOR) AND (DEFINED ENV{SYNERGY_VERSION_MAJOR}))
if (DEFINED ENV{SYNERGY_VERSION_MAJOR}) set (SYNERGY_VERSION_MAJOR $ENV{SYNERGY_VERSION_MAJOR})
set (VERSION_MAJOR $ENV{SYNERGY_VERSION_MAJOR}) set (SYNERGY_VERSION_MINOR $ENV{SYNERGY_VERSION_MINOR})
set (VERSION_MINOR $ENV{SYNERGY_VERSION_MINOR}) set (SYNERGY_VERSION_PATCH $ENV{SYNERGY_VERSION_PATCH})
set (VERSION_REV $ENV{SYNERGY_VERSION_PATCH}) set (SYNERGY_VERSION_STAGE $ENV{SYNERGY_VERSION_STAGE})
set (VERSION_STAGE $ENV{SYNERGY_VERSION_STAGE}) endif()
if (DEFINED SYNERGY_VERSION_MAJOR)
set (VERSION_MAJOR ${SYNERGY_VERSION_MAJOR})
set (VERSION_MINOR ${SYNERGY_VERSION_MINOR})
set (VERSION_REV ${SYNERGY_VERSION_PATCH})
set (VERSION_STAGE ${SYNERGY_VERSION_STAGE})
else() else()
message (WARNING "Synergy version number not set by build environment.") message (WARNING "Synergy version number not set by build environment.")
set (VERSION_MAJOR 1) set (VERSION_MAJOR 1)