File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -361,7 +361,12 @@ option(WITH_VTK "Build VTK-Visualizations" TRUE)
361
361
if (WITH_VTK AND NOT ANDROID)
362
362
find_package (VTK)
363
363
if (VTK_FOUND)
364
- message (STATUS "VTK_MAJOR_VERSION ${VTK_MAJOR_VERSION} " )
364
+ if (NOT DEFINED VTK_RENDERING_BACKEND)
365
+ # On old VTK versions this variable does not exist. In this case it is
366
+ # safe to assume OpenGL backend
367
+ set (VTK_RENDERING_BACKEND "OpenGL" )
368
+ endif ()
369
+ message (STATUS "VTK_MAJOR_VERSION ${VTK_MAJOR_VERSION} , rendering backend: ${VTK_RENDERING_BACKEND} " )
365
370
if (PCL_SHARED_LIBS OR
366
371
(NOT (PCL_SHARED_LIBS) AND NOT (VTK_BUILD_SHARED_LIBS)))
367
372
set (VTK_FOUND TRUE )
@@ -377,6 +382,11 @@ if(WITH_VTK AND NOT ANDROID)
377
382
option (VTK_USE_COCOA "Use Cocoa for VTK render windows" ON )
378
383
MARK_AS_ADVANCED (VTK_USE_COCOA)
379
384
endif (APPLE )
385
+ if (${VTK_RENDERING_BACKEND} STREQUAL "OpenGL" )
386
+ set (VTK_RENDERING_BACKEND_OPENGL_VERSION "1" )
387
+ elseif (${VTK_RENDERING_BACKEND} STREQUAL "OpenGL2" )
388
+ set (VTK_RENDERING_BACKEND_OPENGL_VERSION "2" )
389
+ endif ()
380
390
set (HAVE_VTK ON )
381
391
else ()
382
392
set (VTK_FOUND OFF )
Original file line number Diff line number Diff line change 71
71
/* Address the cases where on MacOS and OpenGL and GLUT are not frameworks */
72
72
#cmakedefine OPENGL_IS_A_FRAMEWORK
73
73
#cmakedefine GLUT_IS_A_FRAMEWORK
74
+
75
+ /* Version of OpenGL used by VTK as rendering backend */
76
+ #define VTK_RENDERING_BACKEND_OPENGL_VERSION ${VTK_RENDERING_BACKEND_OPENGL_VERSION}
77
+
You can’t perform that action at this time.
0 commit comments