MantisBT - CMake
View Issue Details
0012172CMakeModulespublic2011-05-09 23:122012-04-19 13:05
Luiz Angelo Daros de Luca 
Alex Neundorf 
normalmajoralways
closedfixed 
Ubuntu11.04
CMake 2.8.3 
CMake 2.8.8CMake 2.8.8 
0012172: [PATCH] FindRuby does not find ruby-1.9.1 shipped with (k)ubuntu
Hello,

FindRuby only found the 1.8.6 version of my ruby installation, even if I force the RUBY_EXECUTABLE name.
install ubuntu
install both ruby1.8-dev and ruby1.9.1-dev

Use in cmake:

FIND_PACKAGE( Ruby REQUIRED )
SET( RUBY_EXECUTABLE "ruby1.9.1" )

It did not find the ruby library. because it misses a "-" and it does not use full version. Also, RUBY_EXECUTABLE is not an common input. My config is kind of a hack but the fix is still valid.
I did a patch to fix this issue when library is libruby-1.x.x.

I also noticed that there is both RUBY_MAJOR_VERSION and RUBY_VERSION_MAJOR. Is it all right?

Also, some parameters use Ruby_XXX form instead of RUBY_XXX. I guess the default in cmake should be the latter (but it will break previous uses).

At Last, if I have multiple ruby installations, I cannot simply set:

(Ruby_FIND_VERSION "1.9")

This should be the easiest solution. However, I'm no expert in cmake lang.
No tags attached.
related to 0005531closed Alex Neundorf Special handling for ruby vendor directories 
patch find-ruby-library.patch (1,022) 2011-05-09 23:12
https://public.kitware.com/Bug/file/3860/find-ruby-library.patch
Issue History
2011-05-09 23:12Luiz Angelo Daros de LucaNew Issue
2011-05-09 23:12Luiz Angelo Daros de LucaFile Added: find-ruby-library.patch
2011-05-10 15:44Alex NeundorfAssigned To => Alex Neundorf
2011-05-10 15:44Alex NeundorfStatusnew => assigned
2011-05-27 15:40Alex NeundorfNote Added: 0026638
2011-05-27 15:53Luiz Angelo Daros de LucaNote Added: 0026639
2012-01-04 16:13Alex NeundorfRelationship addedrelated to 0005531
2012-01-05 15:55Alex NeundorfNote Added: 0028202
2012-01-05 16:18Alex NeundorfNote Added: 0028204
2012-01-05 16:18Alex NeundorfStatusassigned => closed
2012-01-05 16:18Alex NeundorfResolutionopen => fixed
2012-04-19 13:05David ColeFixed in Version => CMake 2.8.8
2012-04-19 13:05David ColeTarget Version => CMake 2.8.8

Notes
(0026638)
Alex Neundorf   
2011-05-27 15:40   
So your issue is actually two issues ?

1) also look for ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION}

2) support specifying which version of ruby you want ?

Alex
(0026639)
Luiz Angelo Daros de Luca   
2011-05-27 15:53   
Yes. The first is the critical one and I have provided a patch.

The second one is just a suggestion that a cmake expert can fix quickly
(0028202)
Alex Neundorf   
2012-01-05 15:55   
Fixed RUBY_VERSION_MAJOR vs. RUBY_MAJOR_VERSION with 93c55ec (will be in 2.8.8)

Alex
(0028204)
Alex Neundorf   
2012-01-05 16:18   
Specifying the required version is already supported since 2.8.3 via the standard syntax, e.g.:
find_package(Ruby 1.9)

The other two fixes are now merged into next and will be in 2.8.8.