Skip to content

Commit ec2e268

Browse files
Merge pull request #2 from RafaelPalomar/enh/LayerDM_AutoInit
ENH: Enable AutoInit for LayerDM
2 parents fa67cf1 + d27c7ed commit ec2e268

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

LayerDM/MRMLDM/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ set(${KIT}_TARGET_LIBRARIES
6464
)
6565

6666
#-----------------------------------------------------------------------------
67+
6768
SlicerMacroBuildModuleLogic(
6869
NAME ${KIT}
6970
EXPORT_DIRECTIVE ${${KIT}_EXPORT_DIRECTIVE}
@@ -79,4 +80,11 @@ target_include_directories(
7980
${${KIT}_BINARY_DIR}
8081
)
8182

83+
if(${KIT}_AUTOINIT)
84+
set_property(TARGET ${KIT}
85+
APPEND PROPERTY COMPILE_DEFINITIONS
86+
"${KIT}_AUTOINIT=1(${KIT})"
87+
)
88+
endif()
89+
8290
target_compile_features(${KIT} PUBLIC cxx_std_17)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/// vtkSlicerLayerDMModuleMRMLDisplayableManagerExport
2+
///
3+
/// The vtkSlicerLayerDMModuleMRMLDisplayableManagerExport captures some system differences between Unix
4+
/// and Windows operating systems, and enables auto init for the VTK module.
5+
6+
#ifndef __vtkSlicerLayerDMModuleMRMLDisplayableManagerExport_h
7+
#define __vtkSlicerLayerDMModuleMRMLDisplayableManagerExport_h
8+
9+
#if defined(_WIN32) && !defined(MRMLLayerDM_STATIC)
10+
# if defined(vtkSlicerLayerDMModuleMRMLDisplayableManager_EXPORTS)
11+
# define VTK_SLICER_LAYERDM_MODULE_MRMLDISPLAYABLEMANAGER_EXPORT __declspec(dllexport)
12+
# else
13+
# define VTK_SLICER_LAYERDM_MODULE_MRMLDISPLAYABLEMANAGER_EXPORT __declspec(dllimport)
14+
# endif
15+
#else
16+
# define VTK_SLICER_LAYERDM_MODULE_MRMLDISPLAYABLEMANAGER_EXPORT
17+
#endif
18+
19+
#if defined(vtkSlicerLayerDMModuleMRMLDisplayableManager_AUTOINIT)
20+
# include <vtkAutoInit.h>
21+
VTK_AUTOINIT(vtkSlicerLayerDMModuleMRMLDisplayableManager)
22+
#endif
23+
24+
#endif

LayerDM/qSlicerLayerDMModule.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919

2020
#include "vtkMRMLLayerDisplayableManager.h"
2121

22-
#include <vtkAutoInit.h>
23-
24-
VTK_MODULE_INIT(vtkSlicerLayerDMModuleMRMLDisplayableManager);
25-
2622
//-----------------------------------------------------------------------------
2723
qSlicerLayerDMModule::qSlicerLayerDMModule(QObject* _parent)
2824
: Superclass(_parent)

0 commit comments

Comments
 (0)