summaryrefslogtreecommitdiffstats
path: root/Modules/FindRuby.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-16 12:02:26 (GMT)
committerBrad King <brad.king@kitware.com>2017-11-16 12:02:26 (GMT)
commit23ab451a13aa0113de365d2f1a9f82598b160a27 (patch)
treeaa9a8bc1fac73612292c14c8e8e54156fd7786b5 /Modules/FindRuby.cmake
parentbd863785dbc210f97ffecd7c4fcf65b526d4e52d (diff)
downloadCMake-23ab451a13aa0113de365d2f1a9f82598b160a27.zip
CMake-23ab451a13aa0113de365d2f1a9f82598b160a27.tar.gz
CMake-23ab451a13aa0113de365d2f1a9f82598b160a27.tar.bz2
FindRuby: Fix match of '.' in version numbers
Escape `.` so that it is matched literally and not treated as a special match of any character by the regex.
Diffstat (limited to 'Modules/FindRuby.cmake')
-rw-r--r--Modules/FindRuby.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index a9f8d35..8ba1032 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -156,17 +156,17 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
set(RUBY_VERSION_MINOR 8)
set(RUBY_VERSION_PATCH 0)
# check whether we found 1.9.x
- if(${RUBY_EXECUTABLE} MATCHES "ruby1.?9")
+ if(${RUBY_EXECUTABLE} MATCHES "ruby1\\.?9")
set(RUBY_VERSION_MAJOR 1)
set(RUBY_VERSION_MINOR 9)
endif()
# check whether we found 2.0.x
- if(${RUBY_EXECUTABLE} MATCHES "ruby2.?0")
+ if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?0")
set(RUBY_VERSION_MAJOR 2)
set(RUBY_VERSION_MINOR 0)
endif()
# check whether we found 2.1.x
- if(${RUBY_EXECUTABLE} MATCHES "ruby2.?1")
+ if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?1")
set(RUBY_VERSION_MAJOR 2)
set(RUBY_VERSION_MINOR 1)
endif()