@ -405,20 +405,26 @@ get_git_head_revision(STORM_VERSION_REFSPEC STORM_VERSION_GIT_HASH)
git_describe_checkout ( STORM_GIT_VERSION_STRING )
# p a r s e t h e g i t t a g i n t o v a r i a b l e s
string ( REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_VERSION_MINOR "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_VERSION_PATCH "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_VERSION_TAG_HASH "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}" )
# s t a r t w i t h m a j o r . m i n o r . p a t c h
string ( REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)$" STORM_VERSION_MATCH "${STORM_GIT_VERSION_STRING}" )
set ( STORM_VERSION_MAJOR "${CMAKE_MATCH_1}" )
set ( STORM_VERSION_MINOR "${CMAKE_MATCH_2}" )
set ( STORM_VERSION_PATCH "${CMAKE_MATCH_3}" )
set ( STORM_GIT_VERSION_REST "${CMAKE_MATCH_4}" )
# p a r s e r e s t o f t h e form ( -label ) - c o m m i t s a h e a d - h a s h - a p p e n d i x
string ( REGEX MATCH "^(\\-([a-z][a-z0-9\\.]+))?\\-([0-9]+)\\-([a-z0-9]+)(\\-.*)?$" STORM_VERSION_REST_MATCH "${STORM_GIT_VERSION_REST}" )
set ( STORM_VERSION_LABEL "${CMAKE_MATCH_2}" ) # m i g h t b e e m p t y
set ( STORM_VERSION_COMMITS_AHEAD "${CMAKE_MATCH_3}" )
set ( STORM_VERSION_TAG_HASH "${CMAKE_MATCH_4}" )
set ( STORM_VERSION_APPENDIX "${CMAKE_MATCH_5}" ) # m i g h t b e e m p t y
# n o w c h e c k w h e t h e r t h e g i t v e r s i o n l o o k u p f a i l e d
if ( STORM_VERSION_MAJOR MATCHES "NOTFOUND" )
include ( version.cmake )
set ( STORM_VERSION_GIT_HASH "" )
set ( STORM_VERSION_LABEL "" )
set ( STORM_VERSION_COMMITS_AHEAD 0 )
set ( STORM_VERSION_GIT_HASH "" )
set ( STORM_VERSION_DIRTY boost::none )
message ( WARNING "Storm - git version information not available, statically assuming version ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH}." )
else ( )
if ( "${STORM_VERSION_APPENDIX}" MATCHES "^.*dirty.*$" )
@ -428,20 +434,34 @@ else()
endif ( )
endif ( )
# c h e c k w h e t h e r t h e r e i s a label ( 'alpha', 'pre', etc. )
if ( "${STORM_VERSION_LABEL}" STREQUAL "" )
set ( STORM_VERSION_LABEL_STRING "" )
else ( )
set ( STORM_VERSION_LABEL_STRING "-${STORM_VERSION_LABEL}" )
endif ( )
# c h e c k f o r d e v e l o p m e n t v e r s i o n w i t h c o m m i t s a h e a d o f l a t e s t t a g
set ( STORM_VERSION_DEV "false" )
set ( STORM_VERSION_DEV_STRING "" )
if ( STORM_VERSION_COMMITS_AHEAD )
if ( "${STORM_VERSION_LABEL}" STREQUAL "" )
# i n c r e a s e p a t c h n u m b e r t o i n d i c a t e n e w e r v e r s i o n
MATH ( EXPR STORM_VERSION_DEV_PATCH "${STORM_VERSION_PATCH}+1" )
else ( )
set ( STORM_VERSION_DEV_PATCH "${STORM_VERSION_PATCH}" )
endif ( )
set ( STORM_VERSION_DEV "true" )
set ( STORM_VERSION_DEV_STRING " (dev)" )
else ( )
set ( STORM_VERSION_DEV_PATCH ${ STORM_VERSION_PATCH } )
endif ( )
# s e t f i n a l S t o r m v e r s i o n
set ( STORM_VERSION "${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_DEV_PATCH}" )
set ( STORM_VERSION_STRING "${STORM_VERSION}${STORM_VERSION_DEV_STRING}" )
set ( STORM_VERSION_STRING "${STORM_VERSION}${STORM_VERSION_LABEL_STRING}${STORM_VERSION_ DEV_STRING}" )
message ( STATUS "Storm - version is ${STORM_VERSION_STRING} (version ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH} + ${STORM_VERSION_COMMITS_AHEAD} commits), building from git: ${STORM_VERSION_GIT_HASH} (dirty: ${STORM_VERSION_DIRTY})." )
message ( STATUS "Storm - version is ${STORM_VERSION_STRING} (version ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH}${STORM_VERSION_LABEL_STRING} + ${STORM_VERSION_COMMITS_AHEAD} commits), building from git: ${STORM_VERSION_GIT_HASH} (dirty: ${STORM_VERSION_DIRTY})." )
# C o n f i g u r e a h e a d e r f i l e t o p a s s s o m e o f t h e C M a k e s e t t i n g s t o t h e s o u r c e c o d e