diff options
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) |