diff --git a/cmake/version.cmake b/cmake/version.cmake index 749fe4b..f7e271a 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -4,7 +4,7 @@ execute_process( OUTPUT_VARIABLE TABLE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) -string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9].*" TABLE_VALID_VERSION TABLE_VERSION) +string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" TABLE_VALID_VERSION "${TABLE_VERSION}") if (TABLE_VALID_VERSION) string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" TABLE_MAJOR_VERSION "${TABLE_VERSION}") string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" TABLE_MINOR_VERSION "${TABLE_VERSION}") diff --git a/cmake/versioning.cmake b/cmake/versioning.cmake index 609ece1..c8dc8f6 100644 --- a/cmake/versioning.cmake +++ b/cmake/versioning.cmake @@ -15,7 +15,7 @@ if(GIT_FOUND) OUTPUT_VARIABLE TABLE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) - string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9].*" TABLE_VALID_VERSION TABLE_VERSION) + string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" TABLE_VALID_VERSION "${TABLE_VERSION}") if (TABLE_VALID_VERSION) string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" TABLE_MAJOR_VERSION "${TABLE_VERSION}") string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" TABLE_MINOR_VERSION "${TABLE_VERSION}")