From 955c45c30706620e2d31baadb41bdf5e33a75f0e Mon Sep 17 00:00:00 2001 From: Steve Gerbino Date: Wed, 23 Dec 2015 15:40:55 -0500 Subject: [PATCH] Fix for CMake version validation regex expression --- cmake/version.cmake | 2 +- cmake/versioning.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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}")