[CMake] Swig dependencies

James Bigler bigler at cs.utah.edu
Wed Jul 6 13:20:07 EDT 2005


I have a swig target in my CMakeLists.txt file:

SWIG_ADD_MODULE(manta python manta.i manta.cc manta.h)

This will create a mantaPYTHON_wrap.cxx file along with the 
corresponding object files: mantaPYTHON_wrap.o and manta.o.

My manta.i file includes many files from my software library in order to 
generate interfaces.  My problem is that when of these header files 
changes mantaPYTHON_wrap.cxx is not regenerated.  I have to manually 
touch manta.i in order to get it to be created.

Is there a way to manually/automatically add dependencies to 
mantaPYTHON_wrap.cxx, so that it will be remade when something other 
than manta.i is changed?

 > cmake --version
cmake version 2.0.6

swig has an option to generate dependencies for you (-MM,-M).  How could 
I use this list to add a dependency to manta.i?

Thanks,
James


More information about the CMake mailing list