diff options
author | Brad King <brad.king@kitware.com> | 2017-11-16 12:03:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-16 12:05:00 (GMT) |
commit | cd2cdfe2537a43e9ab8700cc0d653f76630f1ed5 (patch) | |
tree | 6bea63fdb68638d960c8da413ffe989a4de9e0ac /Modules/FindRuby.cmake | |
parent | 23ab451a13aa0113de365d2f1a9f82598b160a27 (diff) | |
download | CMake-cd2cdfe2537a43e9ab8700cc0d653f76630f1ed5.zip CMake-cd2cdfe2537a43e9ab8700cc0d653f76630f1ed5.tar.gz CMake-cd2cdfe2537a43e9ab8700cc0d653f76630f1ed5.tar.bz2 |
FindRuby: Add support for versions 2.2, 2.3, and 2.4
Author: J. Peter Mugaas (jpmugaas on gitlab.kitware.com)
Fixes: #17475
Diffstat (limited to 'Modules/FindRuby.cmake')
-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) |