Difference between revisions of "ITK/Release 4/Wrapping/BuildProcess"

From KitwarePublic
< ITK‎ | Release 4‎ | Wrapping
Jump to navigationJump to search
Line 3: Line 3:
=Configuration=
=Configuration=


This is done with CMake. During this step, the template instantiations are generated by parsing the files in Wrapping/WrapITK/Libraries. 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 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.


==Template instantiation==
==Template instantiation==
Line 11: Line 14:
* the libraries, which are grouping several modules. Generally, one binary for a target language contains all the instantiations from one library;
* 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.
* 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.
Several macros are available to simplify the template instantiations.
Line 19: Line 24:


===WRAP_LIBRARIES and END_WRAP_LIBRARIES===
===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===
===WRAP_LIBRARY and END_WRAP_LIBRARY===
Formely BEGIN_WRAPPER_LIBRARY and WRAPPER_LIBRARY_CREATE_LIBRARY.
Formely BEGIN_WRAPPER_LIBRARY and WRAPPER_LIBRARY_CREATE_LIBRARY.

Revision as of 20:12, 12 April 2011

Wrapping build is done in several steps.

Configuration

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.

Template instantiation

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.

Macros

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.

INCLUDE_LIBRARY

AUTO_INCLUDE_MODULES

Formely WRAPPER_LIBRARY_CREATE_WRAP_FILES.

INCLUDE_MODULE

Formely INCLUDE_WRAP_CMAKE.

WRAP_MODULE and END_WRAP_MODULE

WRAP_CLASS

WRAP_NAMED_CLASS

WRAP_NON_TEMPLATE_CLASS

WRAP_NAMED_NON_TEMPLATE_CLASS

WRAP_INCLUDE

END_WRAP_CLASS

ADD_SIMPLE_TYPEDEF

ADD_ONE_TYPEDEF

WRAP_TEMPLATE

WRAP_IMAGE_FILTER_ALL_TYPES

WRAP_IMAGE_FILTER_SCALAR

WRAP_IMAGE_FILTER_VECTOR

WRAP_IMAGE_FILTER_USIGN_INT

WRAP_IMAGE_FILTER_SIGN_INT

WRAP_IMAGE_FILTER_INT

WRAP_IMAGE_FILTER_REAL

WRAP_IMAGE_FILTER_RGB

WRAP_IMAGE_FILTER_RGBA

WRAP_IMAGE_FILTER_VECTOR_REAL

WRAP_IMAGE_FILTER_COV_VECTOR_REAL

WRAP_IMAGE_FILTER_COMPLEX_REAL

WRAP_IMAGE_FILTER

WRAP_IMAGE_FILTER_COMBINATIONS

WRAP_IMAGE_FILTER_TYPES

FILTER_DIMS

Code generator

Everything is done in the 'Languages' directory.

Code generation

Build

Generation XML descriptions of instantiations

Generation of XML documentation

Generation of swig interfaces

Generation of Language specific C++ code

Compilation of C++ code

Linking of libraries

Compilation of tests