Has anyone managed to use CMake to create Ruby bindings through SWIG? I have a working example for creating Python bindings via SWIG in my CMake file, but when I use the same approach to create a Ruby binding, the actual Ruby file is not created. Using a working Python bundle, a Python file is created.
Here are the relevant parts of my CMakeLists.txt file:
if (${SWIG_FOUND})
find_package( Ruby REQUIRED )
include_directories(
${RUBY_INCLUDE_DIRS}
)
include (${SWIG_USE_FILE})
set (CMAKE_SWIG_FLAGS "")
set_source_files_properties (TESTSWIG.i PROPERTIES CPLUSPLUS ON)
SWIG_ADD_MODULE (test-ruby ruby TESTSWIG.i src/Test.cpp)
SWIG_LINK_LIBRARIES (test-ruby test ${RUBY_LIBRARY})
set(swig_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/libtest-ruby.so
)
install(FILES ${swig_SOURCES}
DESTINATION lib/ruby
)
endif(${SWIG_FOUND})
Someone was lucky to create Ruby bindings through SWIG using CMake ?!
Bryan source
share