]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix version parsing.
authormzn <mzn@opencascade.com>
Mon, 20 Aug 2018 16:56:37 +0000 (19:56 +0300)
committermzn <mzn@opencascade.com>
Mon, 20 Aug 2018 16:56:37 +0000 (19:56 +0300)
CMakeCommon/SalomeMacros.cmake

index 970f7c1047deb6e8d8f0a3f7f409ce0eed4c2559..686c8a08b52837b2931f66fecbfd37881fe0e258 100644 (file)
@@ -965,9 +965,13 @@ ENDMACRO(SALOME_CONFIGURE_PREPARE)
 #\r
 MACRO(SALOME_EXTRACT_VERSION version_string major minor patch)\r
   IF(${version_string} MATCHES "[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.[0-9]+[^0-9]*")\r
-    STRING(REGEX REPLACE "^([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*\\.[0-9]+[^0-9]*" "\\1" ${major} "${version_string}")\r
-    STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*" "\\1" ${minor} "${version_string}")\r
-    STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*" "\\1" ${patch} "${version_string}")\r
+    STRING(REGEX REPLACE "^([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*\\.[0-9]+[^0-9]*" "\\1" major "${version_string}")\r
+    STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*" "\\1" minor "${version_string}")\r
+    STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*" "\\1" patch "${version_string}")\r
+  ELSEIF(${version_string} MATCHES "[0-9]+[^0-9]*\\.[0-9]+[^0-9]*")\r
+    STRING(REGEX REPLACE "^([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*" "\\1" major "${version_string}")\r
+    STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*" "\\1" minor "${version_string}")\r
+    SET(PATCH "0")\r
   ELSE()\r
     MESSAGE("MACRO(SALOME_EXTRACT_VERSION ${version_string} ${major} ${minor} ${patch}")\r
     MESSAGE(FATAL_ERROR "Problem parsing version string, I can't parse it properly.")\r