[CMake] Re: [MODULES][UseSWIG] Dependencies automagically computed!

Axel Roebel Axel.Roebel at ircam.fr
Tue Dec 12 05:25:43 EST 2006


On Monday 11 December 2006 21:52, Tristan Carel wrote:
> On 12/9/06, Axel Roebel <Axel.Roebel at ircam.fr> wrote:
> > Tristan Carel wrote:
> > > Hi Swig lovers,
> > >
... cut
> >       DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
>
> Yes, It's exactly what I meant in my previous post when I wrote:
>
> "[...] it's hard to maintain dependencies of the wrapper
> generated by swig because the developper has to manually update the
> CMakeLists.txt [...]"
>
> I asked to CMake maintainers to add the SWIG_MODULE_${name}_EXTRA_DEPS
> variable few months ago, but I didn't know that it could be done
> automatically with the `swig -M' option.
>
> I submitted a patch for `UseSWIG.cmake' in the bug tracker. You say
> that the dependencies are not computed by default by the
> `SWIG_ADD_SOURCE_TO_MODULE'  macro. You probably patched your
> `UseSWIG.cmake' before but ... did you?

Sorry, unfortunately I did not have all my computers updated to cmake 2.4.5 
and so it apears I started with UseSWIG.cmake that comes with cmake 2.4.3. 
After your remark I checked  UseSWIG.cmake from 2.4.5 and that one
does have the missing DEPENDS line already.

So everything works ok then.

> > to the ADD_CUSTOM_COMMANDS in SWIG_ADD_SOURCE_TO_MODULE.
> >
> > The added dependencies are pretty cool then. So I suppose you just
> > forgot to actually use them?
>
> I used them but now I'm fed up to update it each time I modify the
> inclusions of the swig file.
>
> > If you add the DEPENDS line you probably need to check for
> > the case that ${SWIG_MODULE_${name}_EXTRA_DEPS}
> > is empty. Otherwise DEPENDS will probably complain if the
> > argument is an empty list. I have this error all the time
> > for COMPILE_FLAGS, but I am not sure whether
> > DEPENDS behaves similarly.
>
> I've already used the  `SWIG_ADD_SOURCE_TO_MODULE'  without using the
> `${SWIG_MODULE_${name}_EXTRA_DEPS' feature so I guess it properly
> works even if the variable is empty.

Good to know.

Thanks for the effort with UseSWIG.cmake,
it really works great.


-- 
Axel Roebel
IRCAM Analysis/Synthesis Team
Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540


More information about the CMake mailing list