Skip to content

More export templates

Guillaume Pasero requested to merge 1649-extern-templates-take4 into develop


This MR brings more template exports.


This is part of story #1649 (closed).

Implementation Details

CMake mechanism to export all symbols

I had a problem with the export of ITK classes : they are not defined with a proper export macro as we try to do now with extern templates. By default, the compilation of shared libraries in OTB uses -fvisibility=hidden so that symbols are hidden by default (unless explicitely exported). In order to make ITK symbols visible in OTB shared libraries I had to compile them into a dedicated shared lib, and to disable the hidden setting. This is done when declaring the module, with the option EXPORT_ALL, for example, in OTBITK module:

New modules with extern templates

The exports in OTBImageBase and OTBImageIO have been enhanced.

More extern template have been added, in modules:

  • OTBCommon
  • OTBObjectList
  • OTBStreaming
  • OTBVectorDataBase
  • OTBTransform
  • OTBImageExport (new module for ITK templates using Image and VectorImage)
  • OTBImageManipulation
  • OTBStatistics
  • OTBVectorDataManipulation
  • OTBVectorDataIO
Move implementations into cxx

The implementation of some classes has been moved to a dedicated .cxx, for instance :

  • VectorDataFileWriterException
  • ImageKeywordlist
  • QtWidgetParameterBase

Additional notes

The export of itkDynamicCastInDebugMode functions is done in module OTBImageExport.

TODO : show some figure regarding improvements on build time and binaries size.

TODO : add comments proposed by @poughov


The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.

Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
Edited by Guillaume Pasero

Merge request reports