<!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">
I managed to solve the problem by generating each SWIG module in a
separate directory. But it is not possible to use one SWIG interface
file for every module. Thus, I added in every directory a '.i' file
that just includes the original '.i' file from the upper dir (<i>%include
../test.i</i>).<br>
<br>
David<br>
<br>
<br>
Alan W. Irwin wrote:
<blockquote
 cite="mid:Pine.LNX.4.60.0805121430180.1438@ybpnyubfg.ybpnyqbznva"
 type="cite">On 2008-05-12 11:00-0700 David Graf wrote:
  <br>
  <br>
  <blockquote type="cite">Hello
    <br>
    <br>
I have problems to generate Python and Ruby bindings with SWIG in CMake
    <br>
out of one SWIG interface file. In the following example, I have a
small
    <br>
interface file and a CMake file that should generate Ruby and Python
    <br>
bindings. But the Ruby binding is not generated at all and the Python
    <br>
binding is broken because the two generation processes produce a
library
    <br>
file with the same name (_test.so).
    <br>
    <br>
Does someone know how to produce bindings from one interface for
several
    <br>
languages? I need bindings for Ruby, Python, PHP, Java, C#.
    <br>
    <br>
  </blockquote>
  <br>
Multiple bindings should not be a problem for swig and CMake.&nbsp; For
example,
  <br>
PLplot implements python and java bindings using swig.&nbsp; If you want to
see
  <br>
how this example works in detail, look at
  <br>
<a class="moz-txt-link-freetext" href="http://plplot.svn.sourceforge.net/viewvc/plplot/trunk">http://plplot.svn.sourceforge.net/viewvc/plplot/trunk</a>.&nbsp; In particular,
you
  <br>
should look at bindings/swig-support/plplotcapi.i (which defines our
API for
  <br>
swig), and CMakeLists.txt files and *.i files in bindings/python and
  <br>
bindings/java.
  <br>
  <br>
Hope that working example helps you to figure out what is wrong for
your own
  <br>
attempt to build multiple bindings using swig and CMake.
  <br>
  <br>
Alan
  <br>
__________________________
  <br>
Alan W. Irwin
  <br>
  <br>
Astronomical research affiliation with Department of Physics and
Astronomy,
  <br>
University of Victoria (astrowww.phys.uvic.ca).
  <br>
  <br>
Programming affiliations with the FreeEOS equation-of-state
implementation
  <br>
for stellar interiors (freeeos.sf.net); PLplot scientific plotting
software
  <br>
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads
of
  <br>
Linux Links project (loll.sf.net); and the Linux Brochure Project
  <br>
(lbproject.sf.net).
  <br>
__________________________
  <br>
  <br>
Linux-powered Science
  <br>
__________________________
  <br>
</blockquote>
<br>
</body>
</html>