@ -352,40 +352,46 @@ endif(DOXYGEN_FOUND)
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# I f a v e r s i o n w a s p r o v i d e d , w e u s e i t . T h i s i s u s e f u l , f o r e x a m p l e , w h e n s t o r m i s b u i l t
# f r o m a t a r b a l l .
# I f s t o r m i s b u i l t f r o m a n a r c h i v e , w e n e e d t o s k i p t h e v e r s i o n d e t e c t i o n b a s e d o n g i t .
if ( STORM_SOURCE STREQUAL "archive" )
if ( NOT DEFINED STORM_CPP_ VERSION_MAJOR OR NOT DEFINED STORM_CPP_ VERSION_MINOR OR NOT DEFINED STORM_CPP _VERSION_PATCH )
if ( NOT DEFINED STORM_VERSION_MAJOR OR NOT DEFINED STORM_VERSION_MINOR OR NOT DEFINED STORM_VERSION_PATCH )
message ( FATAL_ERROR "storm - Building from archive requires setting a version via cmake." )
endif ( )
message ( STATUS "storm - Version is ${STORM_CPP_ VERSION_MAJOR}.${STORM_CPP_ VERSION_MINOR}.${STORM_CPP _VERSION_PATCH} (building from archive)." )
set ( STORM_CPP_ VERSION_COMMITS_AHEAD boost::none )
set ( STORM_CPP_ VERSION_HASH boost::none )
set ( STORM_CPP_ VERSION_DIRTY boost::none )
message ( STATUS "storm - Version is ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH} (building from archive)." )
set ( STORM_VERSION_COMMITS_AHEAD boost::none )
set ( STORM_VERSION_GIT _HASH boost::none )
set ( STORM_VERSION_DIRTY boost::none )
else ( )
if ( DEFINED STORM_CPP_ VERSION_MAJOR OR DEFINED STORM_CPP_ VERSION_MINOR OR DEFINED STORM_CPP _VERSION_PATCH )
if ( DEFINED STORM_VERSION_MAJOR OR DEFINED STORM_VERSION_MINOR OR DEFINED STORM_VERSION_PATCH )
message ( FATAL_ERROR "storm - Building from git does not support setting a version via cmake." )
endif ( )
# M a k e a v e r s i o n f i l e c o n t a i n i n g t h e c u r r e n t v e r s i o n f r o m g i t .
include ( GetGitRevisionDescription )
get_git_head_revision ( STORM_CPP_VERSION_REFSPEC STORM_CPP_GIT_HASH )
set ( STORM_CPP_GIT_HASH "std::string(\" ${ STORM_CPP_GIT_HASH } \")")
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_CPP_ VERSION_MAJOR "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_ VERSION_MINOR "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_ VERSION_PATCH "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_CPP_ VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_CPP _TAG_HASH "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_CPP_ VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}" )
if ( "${STORM_CPP_ VERSION_APPENDIX}" MATCHES "^.*dirty.*$" )
set ( STORM_CPP_ VERSION_DIRTY 1 )
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}" )
if ( "${STORM_VERSION_APPENDIX}" MATCHES "^.*dirty.*$" )
set ( STORM_VERSION_DIRTY 1 )
else ( )
set ( STORM_CPP_ VERSION_DIRTY 0 )
set ( STORM_VERSION_DIRTY 0 )
endif ( )
message ( STATUS "storm - Version is ${STORM_CPP_VERSION_MAJOR}.${STORM_CPP_VERSION_MINOR}.${STORM_CPP_VERSION_PATCH} (${STORM_CPP_VERSION_COMMITS_AHEAD} commits ahead of tag) build from ${STORM_CPP_GIT_HASH} (dirty: ${STORM_CPP_VERSION_DIRTY}) (building from git)." )
if ( STORM_VERSION_DIRTY )
set ( STORM_VERSION_DIRTY_STR "yes" )
else ( )
set ( STORM_VERSION_DIRTY_STR "no" )
endif ( )
message ( STATUS "storm - version is ${STORM_VERSION_MAJOR}.${STORM_VERSION_MINOR}.${STORM_VERSION_PATCH} (${STORM_VERSION_COMMITS_AHEAD} commits ahead of tag), building from git: ${STORM_VERSION_GIT_HASH} (dirty: ${STORM_VERSION_DIRTY_STR})." )
# p r o p e r t y p e c o n v e r s i o n s o w e c a n a s s i g n i t t o a n o p t i o n a l
set ( STORM_VERSION_GIT_HASH "std::string(\" ${ STORM_VERSION_GIT_HASH } \")")
endif ( )
# 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