MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015345 | CMake | Modules | public | 2015-01-12 07:43 | 2015-06-01 08:38 |
Reporter | David Coppa | ||||
Assigned To | Rolf Eike Beer | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | CMake 3.1 | ||||
Target Version | CMake 3.1.1 | Fixed in Version | CMake 3.1.1 | ||
Summary | 0015345: FindRuby: Problem with "find_package(Ruby 2.0)" | ||||
Description | OS is OpenBSD, but I think this also applies to Linux or other Unix-like OSes. Both ruby-2.0.0 and ruby-2.1.5 are installed on the system: $ ls -1 /usr/local/bin/ruby* /usr/local/bin/ruby20 /usr/local/bin/ruby21 Using "find_package(Ruby 2.1)" works as expected: -- ATTENTION -> Ruby_FIND_VERSION_MINOR == 1 -- ATTENTION -> setting Ruby_FIND_VERSION_SHORT_NODOT... -- --------FindRuby.cmake debug------------ -- _RUBY_POSSIBLE_EXECUTABLE_NAMES: ruby2.1;ruby21;ruby;ruby2.0;ruby20;ruby1.9;ruby19;ruby1.8;ruby18 -- _RUBY_POSSIBLE_LIB_NAMES: ruby;ruby-static;ruby2.1;ruby21;ruby-2.1;ruby-2.1.0 -- RUBY_ARCH_DIR: /usr/local/lib/ruby/2.1/x86_64-openbsd -- RUBY_HDR_DIR: /usr/local/include/ruby-2.1 -- RUBY_POSSIBLE_LIB_DIR: /usr/local/lib -- Found RUBY_VERSION: "2.1.0" , short: "2.1", nodot: "21" -- _RUBY_REQUIRED_VARS: RUBY_EXECUTABLE;RUBY_INCLUDE_DIR;RUBY_LIBRARY;RUBY_CONFIG_INCLUDE_DIR -- RUBY_EXECUTABLE: /usr/local/bin/ruby21 -- RUBY_LIBRARY: /usr/local/lib/libruby21.so.1.0 -- RUBY_INCLUDE_DIR: /usr/local/include/ruby-2.1 -- RUBY_CONFIG_INCLUDE_DIR: /usr/local/include/ruby-2.1/x86_64-openbsd -- -------------------- -- Found Ruby: /usr/local/bin/ruby21 (found suitable version "2.1.0", minimum required is "2.1") ** NOTE: I've added some messages to help understand the problem and set _RUBY_DEBUG_OUTPUT to true. While "find_package(Ruby 2.0)" is broken: -- ATTENTION -> Ruby_FIND_VERSION_MINOR == 0 -- --------FindRuby.cmake debug------------ -- _RUBY_POSSIBLE_EXECUTABLE_NAMES: ruby;ruby2.1;ruby21;ruby2.0;ruby20;ruby1.9;ruby19;ruby1.8;ruby18 -- _RUBY_POSSIBLE_LIB_NAMES: ruby;ruby-static;ruby2.1;ruby21;ruby-2.1;ruby-2.1.0 -- RUBY_ARCH_DIR: /usr/local/lib/ruby/2.1/x86_64-openbsd -- RUBY_HDR_DIR: /usr/local/include/ruby-2.1 -- RUBY_POSSIBLE_LIB_DIR: /usr/local/lib -- Found RUBY_VERSION: "2.1.0" , short: "2.1", nodot: "21" -- _RUBY_REQUIRED_VARS: RUBY_EXECUTABLE;RUBY_INCLUDE_DIR;RUBY_LIBRARY;RUBY_CONFIG_INCLUDE_DIR -- RUBY_EXECUTABLE: /usr/local/bin/ruby21 -- RUBY_LIBRARY: /usr/local/lib/libruby21.so.1.0 -- RUBY_INCLUDE_DIR: /usr/local/include/ruby-2.1 -- RUBY_CONFIG_INCLUDE_DIR: /usr/local/include/ruby-2.1/x86_64-openbsd -- -------------------- -- Found Ruby: /usr/local/bin/ruby21 (found suitable version "2.1.0", minimum required is "2.0") This is because, when "Ruby_FIND_VERSION_MINOR" is 0, the "if(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR)" check at line 61 evaluates to false. Changing line 61 to: "if(DEFINED Ruby_FIND_VERSION_MAJOR AND DEFINED Ruby_FIND_VERSION_MINOR)" works around the issue for me: -- ATTENTION -> Ruby_FIND_VERSION_MINOR == 0 -- ATTENTION -> setting Ruby_FIND_VERSION_SHORT_NODOT ... -- --------FindRuby.cmake debug------------ -- _RUBY_POSSIBLE_EXECUTABLE_NAMES: ruby2.0;ruby20;ruby;ruby2.1;ruby21;ruby1.9;ruby19;ruby1.8;ruby18 -- _RUBY_POSSIBLE_LIB_NAMES: ruby;ruby-static;ruby2.0;ruby20;ruby-2.0;ruby-2.0.0 -- RUBY_ARCH_DIR: /usr/local/lib/ruby/2.0/x86_64-openbsd -- RUBY_HDR_DIR: /usr/local/include/ruby-2.0 -- RUBY_POSSIBLE_LIB_DIR: /usr/local/lib -- Found RUBY_VERSION: "2.0.0" , short: "2.0", nodot: "20" -- _RUBY_REQUIRED_VARS: RUBY_EXECUTABLE;RUBY_INCLUDE_DIR;RUBY_LIBRARY;RUBY_CONFIG_INCLUDE_DIR -- RUBY_EXECUTABLE: /usr/local/bin/ruby20 -- RUBY_LIBRARY: /usr/local/lib/libruby20.so.1.0 -- RUBY_INCLUDE_DIR: /usr/local/include/ruby-2.0 -- RUBY_CONFIG_INCLUDE_DIR: /usr/local/include/ruby-2.0/x86_64-openbsd -- -------------------- -- Found Ruby: /usr/local/bin/ruby20 (found suitable version "2.0.0", minimum required is "2.0") | ||||
Steps To Reproduce | Use "find_package(Ruby 2.0)" or "find_package(Ruby 2.0 EXACT)" | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://public.kitware.com/Bug/file/5342/0001-Fix-FindRuby-find_package-with-version.patch | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2015-01-12 07:43 | David Coppa | New Issue | |||
2015-01-12 08:42 | Rolf Eike Beer | Note Added: 0037670 | |||
2015-01-12 08:45 | Brad King | Target Version | => CMake 3.1.1 | ||
2015-01-12 09:19 | David Coppa | File Added: 0001-Fix-FindRuby-find_package-with-version.patch | |||
2015-01-12 11:45 | Ben Boeckel | Note Added: 0037671 | |||
2015-01-12 12:28 | Rolf Eike Beer | Note Added: 0037672 | |||
2015-01-12 13:31 | Rolf Eike Beer | Note Added: 0037673 | |||
2015-01-12 13:31 | Rolf Eike Beer | Assigned To | => Rolf Eike Beer | ||
2015-01-12 13:31 | Rolf Eike Beer | Status | new => resolved | ||
2015-01-12 13:31 | Rolf Eike Beer | Resolution | open => fixed | ||
2015-01-12 13:31 | Rolf Eike Beer | Category | CMake => Modules | ||
2015-01-12 13:31 | Rolf Eike Beer | Fixed in Version | => CMake 3.1.1 | ||
2015-06-01 08:38 | Robert Maynard | Note Added: 0038835 | |||
2015-06-01 08:38 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|