[CMake] FindPackage(Ruby) on Ubuntu LTS

David Cole david.cole at kitware.com
Wed Oct 24 11:57:27 EDT 2012


On Wed, Oct 24, 2012 at 9:36 AM, Chris <ruunhb at googlemail.com> wrote:
> Hio,
>
> I have some problems with the CMake-Module findRuby.cmake with using ruby1.8
> and ruby1.9 on Ubuntu 12.04 LTS (via apt).
>
> I'm not sure, but i guess it worked some month ago and its maybe broken due
> to an update (or i missed some important aspect in my setup)
>
> A simple find_package(Ruby) call in a CMakeLists.txt results in the error:
> -- Could NOT find Ruby (missing:  RUBY_LIBRARY) (found version "1.9.1")
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/chris/repos/build
>
> $ cmake --version
> cmake version 2.8.7
>
> $ ruby -v
> ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
>
> $ ls /usr/lib | grep ruby
> libqtruby4shared.so.2
> libqtruby4shared.so.2.0.0
> libruby1.8.so
> libruby1.8.so.1.8
> libruby1.8.so.1.8.7
> libruby1.8-static.a
> libruby-1.9.1.so
> libruby-1.9.1.so.1.9
> libruby-1.9.1.so.1.9.1
> libruby-1.9.1-static.a
> ruby
>
> Any ideas?
>
> Chris
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


The following 5 commits were merged to 'master' for FindRuby.cmake
*after* CMake 2.8.7, and probably fix the problem you're seeing. Can
you try with 2.8.8 or later?


# to inspect and figure things out:

$ gitk -- Modules/FindRuby.cmake &


# to show the series of commands that came after 2.8.7 based on commit
hashes revealed by the manual inspection:

$ git log 93c55ec1~1..854e7623 -- Modules/FindRuby.cmake

commit 854e76237ce3e8f03d9cabcad1f8f37e04992ad3
Author: Rolf Eike Beer <eike at sf-mail.de>
Date:   Fri Feb 17 18:06:07 2012 +0100

    FindRuby: clean up querying variables from Ruby

    Newer Ruby versions (from 1.9 onward) seem to warn if you query
Config::CONFIG
    and print a warning to use RbConfig instead. RbConfig seems to also work in
    older versions, at least in 1.8. Use a macro to query RbConfig
first and only
    if that doesn't give anything fall back to Config.

commit 409aeafa2518a1cd38709810ba765860ef21aeb8
Author: Rolf Eike Beer <eike at sf-mail.de>
Date:   Wed Jan 25 17:26:43 2012 +0100

    FindRuby: do not blindly set version to 1.8.0

    RUBY_VERSION was always set, even if no RUBY_EXECUTABLE was found. While it
    may make sense to assume a default version if we can't execute the
binary, it
    certainly doesn't make sense to report a version if there is no
executable at
    all.

commit a9bca052f8ff013d8f47cf365495d2c8d0a2e70f
Author: Alex Neundorf <neundorf at kde.org>
Date:   Thu Jan 5 21:58:49 2012 +0100

    FindRuby.cmake: add more debug output

    Alex

commit 3db2c8b9eafe4cc1d3a6e9d1f3bfc90764544d01
Author: Alex Neundorf <neundorf at kde.org>
Date:   Thu Jan 5 21:57:11 2012 +0100

    FindRuby: add more possible library names (for ubuntu, #12172)

    Alex

commit 93c55ec1421a2cf43dbcaf9afd0528c8dda42de5
Author: Alex Neundorf <neundorf at kde.org>
Date:   Thu Jan 5 21:53:02 2012 +0100

    FindRuby: fix usage of RUBY_VERSION_MAJOR (#12172)

    Alex



HTH,
David


More information about the CMake mailing list