]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
IPAL54523: SALOME_EXTRACT_VERSION cmake macro is broken for version with rc field V9_3_BR V9_3_0 V9_3_0rc1 V9_3_0rc2
authorvsr <vsr@opencascade.com>
Fri, 29 Mar 2019 09:25:53 +0000 (12:25 +0300)
committervsr <vsr@opencascade.com>
Fri, 29 Mar 2019 09:25:53 +0000 (12:25 +0300)
cmake/SalomeMacros.cmake

index 4c3ed09dfb9640c62d5cee818ac9891fa413e494..f6e9388710e42d317fb2d643594524bf49bd3b4e 100644 (file)
@@ -979,13 +979,13 @@ ENDMACRO(SALOME_CONFIGURE_PREPARE)
 # 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")