Any way to test .wrap files without compiling?

Compiling is a lot of time even compiling only the modified module, so detecting an error in a .wrap file when trying to change python wrappers is a pain.

Is there any way to test .wrap files without compiling?
If not, any way to detecting the error faster?

1 Like


There is not way to fully test the wrap file without compiling it. It would be great to have such a mechanism, but it needs to be implemented. One thing you can do though is to try to debug it without the compilation being fully done.

  1. Add message() statements in the file to see at configuration time if the filter types expand to what you expect.
  2. Find the cxx file(s) corresponding to your filter(s) in the build directory. The files that are generated are created in the Wrapping subfolder. Looking at this file will allow you to see if you are wrapping the types you expect.

Hope this helps,


Thanks for the tips.

  1. message() inside .wrap files is working and really useful. It’s output can be seen when configuring with cmake, so it afford a lot of time.
  2. Found the cxx files and it’s really useful to see c++ templates generated for wrapping, detected some errors there too.

It is helpful to just build a module and its dependencies. There is a makefile target called <module-name>-all for all ITK modules. For example:

make ITKCommon-all


ninja ITKCommon-all

will just build the tests and wrapping for the ITKCommon module.

1 Like