summaryrefslogtreecommitdiff
path: root/cmake/mysql_version.cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2010-01-07 02:58:55 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2010-01-07 02:58:55 +0100
commit0fe9b8b35e372f72b7c4383541bcc09341c17d75 (patch)
tree194f2e2ced393e83aeb4c905ef8155db6175df03 /cmake/mysql_version.cmake
parent400f9587c5cb93baa9e06a5e18dacd9bc996a282 (diff)
downloadmariadb-git-0fe9b8b35e372f72b7c4383541bcc09341c17d75.tar.gz
Fix version string parsing
Diffstat (limited to 'cmake/mysql_version.cmake')
-rw-r--r--cmake/mysql_version.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index 6b83cb50b2d..33ac5e479b2 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -55,10 +55,12 @@ MACRO(GET_MYSQL_VERSION)
SET(VERSION ${VERSION_STRING})
+ # Remove trailing (non-numeric) part of the version string
+ STRING(REGEX REPLACE "[^\\.0-9].*" "" VERSION_STRING ${VERSION_STRING})
+
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" MAJOR_VERSION "${VERSION_STRING}")
STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" MINOR_VERSION "${VERSION_STRING}")
STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" PATCH "${VERSION_STRING}")
-
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}")
MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH}")