[CMake] SWIG support throughts : naming conventions

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Aug 13 08:04:49 EDT 2008


On Fri, Aug 8, 2008 at 3:33 PM, Antoine PREVOT <tonio_lesec at yahoo.fr> wrote:
> Hi again,
>
> I am still struggling with SWIG, and tested various things. Since UseSWIG.cmake seems quite similar from 2.4 to 2.6-1, here are some throughts I had while using it.
>
> I don't know if my patches are relevant or not, I am probably using cmake the wrong way, but I'll give it a try ...
>
> Oh, and sorry for multi-posting, but I think it's better to keep different subjects on different threads ;)
>
> - throught
>
> First thing is the naming convention of generated wrappers.
>
> Wrappers (_wrap.cxx files) names are built from their interface file (.i) basename, then concatenated with the wrapped language. ie: wrapping to python, example.i will produce an examplePYTHON_wrap.cxx file. It's intended to wrap a single interface to different languages, great !
>
> BUT, this file name doesn't match swig naming convention. wrapping an "example" module with an example.i interface should generate an example_wrap.cxx file, -and- an example.py script (proxy class declaration).


Filename for the C/C++ file is meaningless.
Filename for the proxy class (at least for python) is working
perfectly for me since cmake 2.0.

The only tricky part is that cmake expect you to call example.i a
module which is defined as:

...
%module(docstring="bla") example
...

See my request for -interface support in cmake (in fact this is not
needed if you respect this filenaming convention)

2 cts
-- 
Mathieu


More information about the CMake mailing list