<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello<br>
<br>
I have problems to generate Python and Ruby bindings with SWIG in CMake
out of one SWIG interface file. In the following example, I have a
small interface file and a CMake file that should generate Ruby and
Python bindings. But the Ruby binding is not generated at all and the
Python binding is broken because the two generation processes produce a
library file with the same name (_test.so).<br>
<br>
Does someone know how to produce bindings from one interface for
several languages? I need bindings for Ruby, Python, PHP, Java, C#.<br>
<br>
David<br>
<br>
<b>Example:</b><br>
<br>
SWIG Interface File:<br>
<i>%module test<br>
%{<br>
&nbsp; int get() { return 5; }<br>
%}<br>
<br>
int get();</i><br>
<br>
CMake File:<br>
<i>PROJECT(swig_test)<br>
<br>
FIND_PACKAGE(SWIG)<br>
INCLUDE(${SWIG_USE_FILE})<br>
<br>
SET_SOURCE_FILES_PROPERTIES(test.i PROPERTIES CPLUSPLUS ON)<br>
<br>
FIND_PACKAGE(PythonLibs)<br>
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})<br>
SWIG_ADD_MODULE(test python test.i)<br>
SWIG_LINK_LIBRARIES(test ${PYTHON_LIBRARIES})<br>
<br>
FIND_PACKAGE(Ruby)<br>
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})<br>
SWIG_ADD_MODULE(test ruby test.i)<br>
SWIG_LINK_LIBRARIES(test ${RUBY_LIBRARY})</i><br>
<br>
</body>
</html>