diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindRuby.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index 8ba1032..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) @@ -170,6 +173,21 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) 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) |