# version 2.7.12+ and the interp is 2.7.12 ...
#
MACRO(SALOME_EXTRACT_VERSION version_string major minor patch)
- IF(${version_string} MATCHES "[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.*[0-9]*[^0-9]*")
- STRING(REGEX REPLACE "^([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*\\.*[0-9]*[^0-9]*" "\\1" ${major} "${version_string}")
- STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*\\.*[0-9]*[^0-9]*" "\\1" ${minor} "${version_string}")
+ IF(${version_string} MATCHES "[0-9]+[^0-9.]*\\.[0-9]+[^0-9.]*\\.*[0-9]*[^0-9]*[0-9]*")
+ STRING(REGEX REPLACE "^([0-9]+)[^0-9.]*\\.[0-9]+[^0-9.]*\\.*[0-9]*[^0-9]*[0-9]*$" "\\1" ${major} "${version_string}")
+ STRING(REGEX REPLACE "^[0-9]+[^0-9.]*\\.([0-9]+)[^0-9.]*\\.*[0-9]*[^0-9]*[0-9]*$" "\\1" ${minor} "${version_string}")
- IF(${version_string} MATCHES "[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.[0-9]+[^0-9]*")
+ IF(${version_string} MATCHES "[0-9]+[^0-9.]*\\.[0-9]+[^0-9.]*\\.[0-9]+[^0-9]*[0-9]*")
# X.Y.Z format (python 3.5.2 ...)
- STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*" "\\1" ${patch} "${version_string}")
+ STRING(REGEX REPLACE "^[0-9]+[^0-9.]*\\.[0-9]+[^0-9.]*\\.([0-9]+)[^0-9]*[0-9]*$" "\\1" ${patch} "${version_string}")
ELSE()
# X.Y format (python 3.5 ...)
SET(${patch} "0")