Configuration - Only link TKIVtk against RenderingGL2PSOpenGL2 when VTK provides it (#1214)

- Guard `vtkRenderingGL2PSOpenGL2` being appended to `USED_TOOLKITS_BY_CURRENT_PROJECT` behind a `TARGET` existence check for both namespaced (VTK 9) and legacy (VTK 7/8) target names.
- Add inline comments documenting why the guard is necessary (module omitted on Android/iOS and when building VTK with GLES).
This commit is contained in:
이대희
2026-04-25 19:55:11 +09:00
committed by GitHub
parent bae76f50db
commit e3a34f5479

View File

@@ -277,7 +277,11 @@ if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2" OR IS_VTK_9XX)
if (${VTK_EXCLUDE_LIBRARY} STREQUAL vtkRenderingOpenGL)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingOpenGL2)
if(VTK_MAJOR_VERSION GREATER 6)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingGL2PSOpenGL2)
# VTK omits RenderingGL2PSOpenGL2 on Android/iOS and under GLES (Emscripten);
# only add the dependency when the target is actually provided.
if (TARGET VTK::RenderingGL2PSOpenGL2 OR TARGET vtkRenderingGL2PSOpenGL2)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingGL2PSOpenGL2)
endif()
endif()
endif()
endif()