diff --git a/VERSION b/VERSION index 4a8e29d062bedb8f30bf7710975d8033f8eeabe8..c4094197f9c4174e7cc8cee1a5ec0813e14bf97c 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7a34c2a67ddfe847f2d5ba516060077ccd10e483..b280fd83c98ca723e4ab144b22f35aaadc5feb3e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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}") # --------------------------------------------------------------------------------------------------------------------------------------------------- # diff --git a/tools/cmake/BuildUtils.cmake b/tools/cmake/BuildUtils.cmake index 76b0c20daed91b7d8a3ef62bdc03190585d37e16..b62df871b3fc7492c14c74994308d52245014bd9 100644 --- a/tools/cmake/BuildUtils.cmake +++ b/tools/cmake/BuildUtils.cmake @@ -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 ) diff --git a/tools/packaging/owpack b/tools/packaging/owpack index 1c469b5e1c665f97d687b826414ebdde09073afc..e522bb3d4d9827415e21e17653fbe94b825bb2d4 100755 --- a/tools/packaging/owpack +++ b/tools/packaging/owpack @@ -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"