Wrapping build is done in several steps.
The configuration is done with with the tool used to build ITK: CMake. All the files cited in this section are located in the ITK/Wrapping/WrapITK directory.
During this step, the template instantiations are generated with a several CMake macros. For each macro call of the template instantiation process, some callback macros specific of each language generator are called to generate the files and the commands needed to build the wrappers. The template instantiation and the code generation are completely separated.
Everything is done in the `Libraries` directory. The instantiations are separated in two levels:
- the libraries, which are grouping several modules. Generally, one binary for a target language contains all the instantiations from one library;
- the modules, inside those libraries. Each module groups several template instantiations. The swig interface generator generates one '.i' file per module.
Even if it is usually a good idea to follow this structure, the generators are not forced to respect this structure. They are free to generate what they wan how they want.
Several macros are available to simplify the template instantiations.
The macros are defined in TypedefMacros.cmake.
WRAP_LIBRARIES and END_WRAP_LIBRARIES
WRAP_LIBRARIES is called before generating any library. The generator should use the call back on this macro if they need to perform some initialization step. END_WRAP_LIBRARIES is called after the last instantiation in the last library is done. The generators should use the callback on this macro to create some extra step — for example to build the tests.
WRAP_LIBRARY and END_WRAP_LIBRARY
Formely BEGIN_WRAPPER_LIBRARY and WRAPPER_LIBRARY_CREATE_LIBRARY.
WRAP_MODULE and END_WRAP_MODULE
Everything is done in the 'Languages' directory.