File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,21 @@ set(OCCLIB_PRODUCT_NAME "OCC Library")
4545set (OCCLIB_PRODUCT_MAINTAINER "Teo Mrnjavac <teo.mrnjavac@cern.ch>" )
4646set (OCCLIB_DESCRIPTION_SUMMARY "The O² Configuration and Control library" )
4747
48+ # Read version number from VERSION file in parent dir
4849set (OCC_VERSION_MAJOR 0)
49- set (OCC_VERSION_MINOR 5 )
50+ set (OCC_VERSION_MINOR 0 )
5051set (OCC_VERSION_PATCH 0)
5152
53+ set (VERSION_FILE "${CMAKE_SOURCE_DIR} /../VERSION" )
54+ file (READ "${VERSION_FILE} " VERSION_DATA)
55+
56+ string (REGEX MATCH "VERSION_MAJOR := ([0-9]*)" _ ${VERSION_DATA} )
57+ set (OCC_VERSION_MAJOR ${CMAKE_MATCH_1} )
58+ string (REGEX MATCH "VERSION_MINOR := ([0-9]*)" _ ${VERSION_DATA} )
59+ set (OCC_VERSION_MINOR ${CMAKE_MATCH_1} )
60+ string (REGEX MATCH "VERSION_PATCH := ([0-9]*)" _ ${VERSION_DATA} )
61+ set (OCC_VERSION_PATCH ${CMAKE_MATCH_1} )
62+
5263set (OCC_VERSION ${OCC_VERSION_MAJOR} .${OCC_VERSION_MINOR} .${OCC_VERSION_PATCH} )
5364set (OCC_VERSION_SHORT ${OCC_VERSION} )
5465
You can’t perform that action at this time.
0 commit comments