mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
Configuration - Git commit info missed #323
Fixed issue with missed git info as a part of dev version. Add option to enable/disable git hash extraction in version string.
This commit is contained in:
parent
4b608f0bf8
commit
45a52dfce7
@ -638,14 +638,25 @@ function (OCC_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANC
|
||||
|
||||
set (SET_OCC_VERSION_DEVELOPMENT "")
|
||||
if (${OCCT_ON_DEVELOPMENT})
|
||||
OCCT_GET_GIT_HASH()
|
||||
# Use special flag from cache to turn on or off git hash extraction
|
||||
if (NOT DEFINED USE_GIT_HASH)
|
||||
set (USE_GIT_HASH ON CACHE BOOL "Use git hash in version string")
|
||||
endif()
|
||||
if (${USE_GIT_HASH})
|
||||
OCCT_GET_GIT_HASH()
|
||||
endif()
|
||||
if (NOT "${GIT_HASH}" STREQUAL "")
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}-${GIT_HASH}")
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
|
||||
else()
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}")
|
||||
endif()
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}")
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
|
||||
set (SET_OCC_VERSION_DEVELOPMENT "#define OCC_VERSION_DEVELOPMENT \"${OCC_VERSION_DEVELOPMENT}\"")
|
||||
set (SET_OCC_VERSION_DEVELOPMENT "${SET_OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET(USE_GIT_HASH)
|
||||
endif()
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
Loading…
x
Reference in New Issue
Block a user