Skip to content

Commit e91d475

Browse files
AlexyPellegrinihjmjohnson
authored andcommitted
COMP: Enable back ITKVtkGlue module in Python wrapping
1 parent b05a1fe commit e91d475

File tree

2 files changed

+32
-39
lines changed

2 files changed

+32
-39
lines changed

Modules/Bridge/VtkGlue/itk-module-init.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ set(
6060
_required_vtk_libraries
6161
${_target_prefix}IOImage
6262
${_target_prefix}ImagingSources
63+
${_target_prefix}kwiml
64+
${_target_prefix}vtksys
6365
)
6466
if(ITK_WRAP_PYTHON)
6567
list(
Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,36 @@
11
# Forward include directories to CastXML
2-
if(NOT VTK_RENDERING_BACKEND STREQUAL "None")
3-
foreach(_vtk_lib IN LISTS ITKVtkGlue_VTK_LIBRARIES)
4-
get_target_property(
5-
_vtk_lib_include_dirs
6-
${_vtk_lib}
7-
INTERFACE_INCLUDE_DIRECTORIES
8-
)
9-
if(_vtk_lib_include_dirs)
10-
include_directories(${_vtk_lib_include_dirs})
11-
endif()
12-
endforeach()
13-
endif()
2+
foreach(_vtk_lib IN LISTS ITKVtkGlue_VTK_LIBRARIES)
3+
get_target_property(
4+
_vtk_lib_include_dirs
5+
${_vtk_lib}
6+
INTERFACE_INCLUDE_DIRECTORIES
7+
)
8+
if(_vtk_lib_include_dirs)
9+
include_directories(${_vtk_lib_include_dirs})
10+
endif()
11+
endforeach()
1412

15-
# Python provides native conversion between ITK and VTK
16-
if(ITK_WRAP_PYTHON)
13+
itk_wrap_module(ITKVtkGlue)
14+
if("${VTK_VERSION}" VERSION_LESS 7.0.0)
1715
message(
18-
STATUS
19-
"ITK_WRAP_PYTHON is turned on - skipping ITKVtkGlue, since native version is available https://docs.itk.org/en/latest/learn/python_quick_start.html#itk-and-vtk."
16+
WARNING
17+
"The ITKVtkGlue module can only built with Python 3 and VTK >= 7."
2018
)
2119
else()
22-
itk_wrap_module(ITKVtkGlue)
23-
if("${VTK_VERSION}" VERSION_LESS 7.0.0)
24-
message(
25-
WARNING
26-
"The ITKVtkGlue module can only built with Python 3 and VTK >= 7.\n"
27-
"Only the c++ version of the module will be built."
28-
)
29-
else()
30-
list(
31-
APPEND
32-
WRAPPER_SWIG_LIBRARY_FILES
33-
"${CMAKE_CURRENT_SOURCE_DIR}/VtkGlue.i"
34-
)
35-
set(
36-
WRAPPER_LIBRARY_DEPENDS
37-
ITKCommon
38-
ITKVTK
39-
)
40-
41-
set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES})
42-
43-
itk_auto_load_and_end_wrap_submodules()
44-
endif()
20+
list(
21+
APPEND
22+
WRAPPER_SWIG_LIBRARY_FILES
23+
"${CMAKE_CURRENT_SOURCE_DIR}/VtkGlue.i"
24+
)
25+
set(
26+
WRAPPER_LIBRARY_DEPENDS
27+
ITKCommon
28+
ITKVTK
29+
)
30+
set(
31+
WRAPPER_LIBRARY_LINK_LIBRARIES
32+
${ITK_LIBRARIES}
33+
${ITKVtkGlue_VTK_LIBRARIES}
34+
)
35+
itk_auto_load_and_end_wrap_submodules()
4536
endif()

0 commit comments

Comments
 (0)