[CMake] Making swig wrapper depend on the involved headers

Daniel Russel drussel at gmail.com
Wed Dec 19 16:18:47 EST 2012


I'm using the shipped UseSWIG package to add a swig module to my project (cmake 2.8). For those that don't know, swig works by running the swig command on an input file (a .i) and then building the files that it produces. The input file tells swig to scan certain header files and the output file depends on the contents of the header files. As a result, when one of the headers changes, swig needs to be rerun. However, this does not occur and I can't figure out a way to manually add the needed dependencies to cmake either (I've tried various things with setting source DEPENDENCY property and the ADD_DEPENDENCIES command passing in the dependencies). Any suggestions? Thanks.


More information about the CMake mailing list