From: mzn Date: Mon, 20 Aug 2018 16:56:37 +0000 (+0300) Subject: Fix version parsing. X-Git-Tag: SHAPER_V9_1_0RC1~51 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=19d3bf37fef9ae5d604821d4422eb53310a7f82e;p=modules%2Fshaper.git Fix version parsing. --- diff --git a/CMakeCommon/SalomeMacros.cmake b/CMakeCommon/SalomeMacros.cmake index 970f7c104..686c8a08b 100644 --- a/CMakeCommon/SalomeMacros.cmake +++ b/CMakeCommon/SalomeMacros.cmake @@ -965,9 +965,13 @@ ENDMACRO(SALOME_CONFIGURE_PREPARE) # 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}") - 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]*" "\\1" major "${version_string}") + STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*" "\\1" minor "${version_string}") + STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*" "\\1" patch "${version_string}") + ELSEIF(${version_string} MATCHES "[0-9]+[^0-9]*\\.[0-9]+[^0-9]*") + STRING(REGEX REPLACE "^([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*" "\\1" major "${version_string}") + STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*" "\\1" minor "${version_string}") + SET(PATCH "0") ELSE() MESSAGE("MACRO(SALOME_EXTRACT_VERSION ${version_string} ${major} ${minor} ${patch}") MESSAGE(FATAL_ERROR "Problem parsing version string, I can't parse it properly.")