= Background
Various early attempts to fix problems with dynamic_casting seems to have resulted in various approaches to how exporting symbols is defined in macros.
= My understanding
We should constently use the partially implemented https://cmake.org/cmake/help/v3.10/module/GenerateExportHeader.html
Use the target properties CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN can be used to add the appropriate compile flags for targets. See the documentation of those target properties, and the convenience variables CMAKE_CXX_VISIBILITY_PRESET and CMAKE_VISIBILITY_INLINES_HIDDEN.
** In its current state, there is a mix of cmake behavior and various customized one-off solutions that can be inconsistent with each other and cmake.
== OPTION 1 (This is what I think we should do)
Use GenerateExportHeader to generate a single ITKExport.h file at config time, include that in itkMacro.h and remove both
Generate a single ITK_TEMPLATE_EXPORT
currently we include files like (#include “ITKIOImageBaseExport.h”) but we don’t use any of those defined macros, we use ITK_TEMPLATE_EXPORT instead.
== OPTION 2 . (this is where I started with this PR but stopped for discussion first.
Generate one export header per library and include the files as necessary.
current generate header : number of includes
ClientTestLibraryAExport.h : 1
ClientTestLibraryBExport.h : 1
ClientTestLibraryCExport.h : 1
ITKBiasCorrectionExport.h : 2
ITKCommonExport.h : 1
ITKIOBMPExport.h : 2
ITKIOBioRadExport.h : 2
ITKIOBrukerExport.h : 2
ITKIOCSVExport.h : 1
ITKIOGDCMExport.h : 3
ITKIOGEExport.h : 9
ITKIOGIPLExport.h : 2
ITKIOHDF5Export.h : 2
ITKIOIPLExport.h : 3
ITKIOImageBaseExport.h : 15
ITKIOJPEG2000Export.h : 2
ITKIOJPEGExport.h : 2
ITKIOLSMExport.h : 2
ITKIOMINCExport.h : 2
ITKIOMRCExport.h : 3
ITKIOMeshBYUExport.h : 3
ITKIOMeshBaseExport.h : 5
ITKIOMeshExport.h : 16
ITKIOMeshVTKExport.h : 3
ITKIOMetaExport.h : 4
ITKIONIFTIExport.h : 2
ITKIONRRDExport.h : 2
ITKIOPNGExport.h : 2
ITKIOSiemensExport.h : 2
ITKIOStimulateExport.h : 2
ITKIOTIFFExport.h : 3
ITKIOTransformBaseExport.h : 5
ITKIOTransformHDF5Export.h : 2
ITKIOTransformInsightLegacyExport.h : 2
ITKIOTransformMatlabExport.h : 2
ITKIOVTKExport.h : 2
ITKIOXMLExport.h : 6
ITKKLMRegionGrowingExport.h : 4
ITKLabelMapExport.h : 1
ITKMeshExport.h : 2
ITKOptimizersExport.h : 31
ITKOptimizersv4Export.h : 7
ITKPathExport.h : 0
ITKPolynomialsExport.h : 1
ITKQuadEdgeMeshExport.h : 1
ITKSpatialObjectsExport.h : 54
ITKStatisticsExport.h : 11
ITKTransformExport.h : 41
ITKVTKExport.h : 1
ITKVideoCoreExport.h : 3
ITKVideoIOExport.h : 4
ITKWatershedsExport.h : 2
= Other code places where symbol exporting is done differently: