MantisBT - CMake
View Issue Details
0006244CMakeModulespublic2008-01-15 07:522016-06-10 14:30
Daniel Tihelka 
Bill Hoffman 
normalmajoralways
closedmoved 
 
 
0006244: change of .i SWIG files does not cause correct rebuild
When I use CMake to for SWIG wrapper, using SWIG package and SWIG_* commands (see uploaded file for details), and I change any of .i files, the change does not cause correct rebuild of wrapped library - it does not delete .cxx, .so and language specific (*.py, *.java, etc.) files generated by SWIG. Even using 'make clean' does not affect those files, and thus does not build wrapper correctly :-(

Note (I don know if it may cause this problem), that the SWIG-related part of my project have the following directory structure:

wrap
|- MyModule.i
|- MyGlobalDefine.i
|- MyException.i
|- MyDynArray.i
|- MyTextNormalizer.i
|- MyTextNormalizerSetting.i
|- python
| |- MyModulePython.i
|-java
| |- MyModuleJava.i


Modules MyModulePython.i and MyModuleJava.i inlude MyModule.i only (one direcory up, telling to SWIG by -I option, see SET_SOURCE_FILES_PROPERTIES in CMakeList.txt), and MyModule.i includes other files only, like:

%include MyGlobalDefine.i
%include MyException.i
%include MyDynArray.i

%include MyTextNormalizer.i
%include MyTextNormalizerSetting.i


----
CMake version: 2.4.6 from Gentoo portage
No tags attached.
txt CMakeLists.txt (854) 2008-01-15 07:52
https://public.kitware.com/Bug/file/1285/CMakeLists.txt
Issue History
2008-01-15 07:52Daniel TihelkaNew Issue
2008-01-15 07:52Daniel TihelkaFile Added: CMakeLists.txt
2008-01-15 11:31Bill HoffmanStatusnew => assigned
2008-01-15 11:31Bill HoffmanAssigned To => Bill Hoffman
2008-10-01 17:02Bill HoffmanNote Added: 0013690
2009-07-22 11:58Daniel LeaNote Added: 0016937
2009-09-28 17:35Clinton StimpsonNote Added: 0017807
2016-06-10 14:27Kitware RobotNote Added: 0041406
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0013690)
Bill Hoffman   
2008-10-01 17:02   
Is this working in cmake 2.6
(0016937)
Daniel Lea   
2009-07-22 11:58   
Confirming part of this as an issue for me in 2.6.2, however a make clean of the directory does function correctly, allowing good subsequent rebuilds. Also note I am working with others' macros, and I'm not particularly familiar with CMake or SWIG.

Example:
In CMakeLists.txt:

   SET_SOURCE_FILES_PROPERTIES(Example.i PROPERTIES CPLUSPLUS ON)
   SWIG_ADD_MODULE(Example python Example.i)

In Example.i:

   %include "ExampleExtraDeclarations.i"

Changes to ExampleExtraDeclarations.i do not cause ExamplePYTHON_wrap.cxx to be rebuilt on make.
(0017807)
Clinton Stimpson   
2009-09-28 17:35   
This is a problem for me too.
That's why I set
FindSWIG.cmake has a SWIG_MODULE_foo_EXTRA_DEPS variable you can set to manually specify those dependencies.
A dependency scanner would be nice.
(0041406)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.