Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Modules/Bridge/VtkGlue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ set(
set(VTK_DIR \"${VTK_DIR}\")
find_package(VTK 9.1 NO_MODULE REQUIRED)
if(NOT VTK_RENDERING_BACKEND)
set(VTK_RENDERING_BACKEND OpenGL2)
if(TARGET VTK::RenderingOpenGL2)
Comment thread
hjmjohnson marked this conversation as resolved.
set(VTK_RENDERING_BACKEND OpenGL2)
else()
set(VTK_RENDERING_BACKEND None)
endif()
endif()
set(_target_freetypeopengl)
if(TARGET VTK::RenderingFreeType\${VTK_RENDERING_BACKEND})
Expand Down Expand Up @@ -123,7 +127,11 @@ if(NOT ITK_BINARY_DIR)
set(VTK_DIR \"${VTK_DIR}\")
find_package(VTK 9.1 NO_MODULE REQUIRED)
if(NOT VTK_RENDERING_BACKEND)
set(VTK_RENDERING_BACKEND OpenGL2)
if(TARGET VTK::RenderingOpenGL2)
set(VTK_RENDERING_BACKEND OpenGL2)
else()
set(VTK_RENDERING_BACKEND None)
endif()
endif()
set(_target_freetypeopengl)
if(TARGET VTK::RenderingFreeType\${VTK_RENDERING_BACKEND})
Expand Down
7 changes: 6 additions & 1 deletion Modules/Bridge/VtkGlue/itk-module-init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ set(VERSION_MIN "9.1.0")

find_package(VTK ${VERSION_MIN} NO_MODULE REQUIRED)

# VTK 9 omits VTK_RENDERING_BACKEND; infer rendering support from its OpenGL2 target.
if(NOT VTK_RENDERING_BACKEND)
set(VTK_RENDERING_BACKEND OpenGL2)
if(TARGET VTK::RenderingOpenGL2)
set(VTK_RENDERING_BACKEND OpenGL2)
else()
set(VTK_RENDERING_BACKEND None)
endif()
endif()

set(_target_freetypeopengl)
Expand Down
17 changes: 10 additions & 7 deletions Modules/Bridge/VtkGlue/wrapping/itkViewImage.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
itk_wrap_class("itk::ViewImage")
unique(types "${WRAP_ITK_SCALAR}")
foreach(d ${ITK_WRAP_IMAGE_DIMS})
foreach(t ${types})
itk_wrap_template("${ITKM_I${t}${d}}" "${ITKT_I${t}${d}}")
# itk::ViewImage needs vtkRenderWindow, absent from a rendering-free VTK.
if(NOT VTK_RENDERING_BACKEND STREQUAL "None")
itk_wrap_class("itk::ViewImage")
unique(types "${WRAP_ITK_SCALAR}")
foreach(d ${ITK_WRAP_IMAGE_DIMS})
foreach(t ${types})
itk_wrap_template("${ITKM_I${t}${d}}" "${ITKT_I${t}${d}}")
endforeach()
endforeach()
endforeach()
itk_end_wrap_class()
itk_end_wrap_class()
endif()
Loading