3

Im trying to build Qpid. When running CMake this is printed to the log:

Could NOT find Ruby  (missing:  RUBY_LIBRARY)

[ ... more stuff cut for brevity ]

CMake Error at src/CMakeLists.txt:96 (include):
  include could not find load file:

    C:/qpid/0.6/qpid/build/src/rubygen.cmake

It seems to be failing because it couldnt find a file thats supposed to have been generated. But it hasn't since it couldn't locate Ruby.

But it seems to at least partially find Ruby since a bunch of other RUBY_* variables have been set in CMake like RUBY_EXECUTABLE and RUBY_INCLUDE_DIR.

What is RUBY_LIBRARY and what is it supposed to be set to? Ruby is installed in C:\Ruby192.

Mizipzor
  • 51,151
  • 22
  • 97
  • 138

1 Answers1

1

According to /usr/share/cmake-2.8/Modules/FindRuby.cmake:

#  RUBY_LIBRARY      = full path to the ruby library

I see you're on Windows. I would guess that to link against the DLL, you'd either point at ${RUBY_DIR}\lib\msvcrt-ruby191.lib or ${RUBY_DIR}\bin\msvcrt-ruby191.dll (I'm using the names from a Ruby 1.9.1 binary I grabbed from ruby-lang.org). To link against the static library, you'll want ${RUBY_DIR}\lib\msvcrt-ruby-191-static.lib.

I have no idea if the fact that these libraries are built against msvcrt will cause problems when linking with the VS2008 compiler. I gave that hairball away long ago.

Jack Kelly
  • 18,264
  • 2
  • 56
  • 81
  • I use the compiler in Visual Studio 2008. – Mizipzor Oct 08 '10 at 09:48
  • 1
    Typically, library variables in CMake should be set to the full path to the library file used by the linker... For dlls, it's the corresponding .lib import library file. In this case, "${RUBY_DIR}/lib/msvcrt-ruby191.lib" – DLRdave Feb 25 '11 at 23:21
  • I know this is an old discussion but I'm running into the same "missing RUBY_LIBRARY" problem trying to build WebKit on Windows. Curiously, the library files installed in c:\Ruby193\lib are named libmsvcrt-ruby191.dll.a and libmsvcrt-ruby191-static.a. Those are incorrect (Unix) names for Windows library files. How do I fix that? Follow-up question: RUBY_LIBRARY can be set as an environment variable, correct? – Phil Jul 03 '14 at 21:37
  • @Phil `RUBY_LIBRARY` is CMake variable. You can set it with `-DRUBY_LIBRARY=` parameter when running `cmake`. CMake variables are (in general) different from environment variables. Setting these manually is an desperate act of last result. Builds are supposed to autodetect those. – user7610 Apr 11 '20 at 14:23