diff options
author | Brad King <brad.king@kitware.com> | 2017-11-17 15:15:18 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-11-17 15:15:25 (GMT) |
commit | 7dfeafaaaa15e0ff80e00cb875d4f037bf08b0aa (patch) | |
tree | 748dd90dbbec307097a59d5e3d06d60d50e38a48 /Modules | |
parent | d261704ef529b420ac04335364344a91b4c9d95f (diff) | |
parent | cd2cdfe2537a43e9ab8700cc0d653f76630f1ed5 (diff) | |
download | CMake-7dfeafaaaa15e0ff80e00cb875d4f037bf08b0aa.zip CMake-7dfeafaaaa15e0ff80e00cb875d4f037bf08b0aa.tar.gz CMake-7dfeafaaaa15e0ff80e00cb875d4f037bf08b0aa.tar.bz2 |
Merge topic 'FindRuby-through-2.4'
cd2cdfe2 FindRuby: Add support for versions 2.2, 2.3, and 2.4
23ab451a FindRuby: Fix match of '.' in version numbers
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1493
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindRuby.cmake | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index a9f8d35..bd9f835 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -59,6 +59,9 @@ else() endif() if(NOT Ruby_FIND_VERSION_EXACT) + list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.4 ruby24) + list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.3 ruby23) + list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.2 ruby22) list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.1 ruby21) list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.0 ruby20) list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby1.9 ruby19) @@ -156,20 +159,35 @@ 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() + # check whether we found 2.2.x + if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?2") + set(RUBY_VERSION_MAJOR 2) + set(RUBY_VERSION_MINOR 2) + endif() + # check whether we found 2.3.x + if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?3") + set(RUBY_VERSION_MAJOR 2) + set(RUBY_VERSION_MINOR 3) + endif() + # check whether we found 2.4.x + if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?4") + set(RUBY_VERSION_MAJOR 2) + set(RUBY_VERSION_MINOR 4) + endif() endif() if(RUBY_VERSION_MAJOR) |