Commit 3fb54624 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[ADD] - VERSION file now allows fixed revision number too. Needed for build script

parent 14424394
......@@ -2,13 +2,17 @@
# used and parsed. This file has to be here everytime. The VERSION needs to be
# set properly or CMake will fail.
#
# SYNTAX: The version string always is X.Y.Z with an optional postfix of "+hg".
# If this postfix is set, CMake will replace it with the Mercurial
# Revision. This is useful for packaging in most cases.
# SYNTAX: The version string always is 1.2.3 with an optional postfix of "+hg1234".
# This is useful if building is done by scripts. If you want to automatically
# add the correct HG revision, use only +hgX without number.
#
# IMPORTANT: If you modify the file, cmake re-creates the version header. But
# it is not able to set all library version. Please re-run cmake if
# you change something here.
#
# NOTE: do not add a space after #. The current CMake script will fail.
VERSION=1.2.0+hg
# Examples:
#VERSION=1.2.0
#VERSION=1.2.0+hgX -> replaces the X with the current revision number
#VERSUIB=1.2.0+hg1234 -> here, revision number was set by the build scripts for example.
VERSION=1.2.0+hgX
......@@ -183,6 +183,7 @@ GET_VERSION_STRING( OW_VERSION OW_API_VERSION )
# We need a SOVERSION too. This somehow describes the API compatibility. We use the major number here.
SPLIT_VERSION_STRING( ${OW_API_VERSION} OW_VERSION_MAJOR OW_VERSION_MINOR OW_VERSION_PATCH )
SET( OW_SOVERSION ${OW_VERSION_MAJOR} )
MESSAGE( FATAL_ERROR "Hall:${OW_VERSION}")
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
......
......@@ -434,7 +434,7 @@ FUNCTION( GET_VERSION_STRING _version _api_version )
# Read the version file
FILE( READ ${OW_VERSION_FILENAME} OW_VERSION_FILE_CONTENT )
# The first regex will mathc
STRING( REGEX REPLACE ".*[^#]VERSION=([0-9]+\\.[0-9]+\\.[0-9]+(\\+hg)?).*" "\\1" OW_VERSION_FILE ${OW_VERSION_FILE_CONTENT} )
STRING( REGEX REPLACE ".*[^#]VERSION=([0-9]+\\.[0-9]+\\.[0-9]+(\\+hgX?[0-9]*)?).*" "\\1" OW_VERSION_FILE ${OW_VERSION_FILE_CONTENT} )
STRING( COMPARE EQUAL ${OW_VERSION_FILE} ${OW_VERSION_FILE_CONTENT} OW_VERSION_FILE_INVALID )
IF( OW_VERSION_FILE_INVALID )
UNSET( OW_VERSION_FILE )
......@@ -463,7 +463,7 @@ FUNCTION( GET_VERSION_STRING _version _api_version )
STRING( REGEX REPLACE "\\+hg" "" OW_VERSION ${OW_VERSION_FILE} )
ELSE()
# if we have the mercurial info -> complement the version string
STRING( REGEX REPLACE "hg" "hg${OW_VERSION_HG}" OW_VERSION ${OW_VERSION_FILE} )
STRING( REGEX REPLACE "hgX" "hg${OW_VERSION_HG}" OW_VERSION ${OW_VERSION_FILE} )
ENDIF()
SET( ${_version} ${OW_VERSION} PARENT_SCOPE )
......
......@@ -28,10 +28,11 @@
# User Variables
#############################################################################################################
# The version. This is used multiple times. Please set before going on.
VERSION=1.2.1
REVISION=default
# The version. This is used multiple times. Please set before going on.
VERSION=1.2.1+hg`hg parents --template "{rev}"`
# Where to find the code
REPOSITORY="ssh://ebaum@berkeley.informatik.uni-leipzig.de//srv/hg/OpenWalnut"
......
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