Skip to content

Commit

Permalink
Support building visualizer with newer VTK
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Garbuzov committed Sep 10, 2018
1 parent 5fa0167 commit fdec975
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 18 additions & 2 deletions ouster_viz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,25 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")

find_package(Threads)
find_package(Eigen3 REQUIRED)
find_package(VTK REQUIRED)
find_package(VTK REQUIRED COMPONENTS vtkCommonCore NO_MODULE)

add_subdirectory(../ouster_client ouster_client)
# Load additional vtk components; prefer newer vtk opengl module
# https://www.visitusers.org/index.php?title=VTK_7.1_Upgrade
# https://www.vtk.org/Wiki/VTK/Build_System_Migration
set(VIZ_VTK_COMPONENTS vtkCommonCore vtkCommonDataModel vtkCommonMath
vtkCommonTransforms vtkFiltersSources vtkImagingCore vtkInteractionStyle
vtkRenderingCore
)
if(TARGET vtkRenderingOpenGL2)
list(APPEND VIZ_VTK_COMPONENTS vtkRenderingOpenGL2)
else()
list(APPEND VIZ_VTK_COMPONENTS vtkRenderingOpenGL)
endif()
find_package(VTK REQUIRED COMPONENTS ${VIZ_VTK_COMPONENTS} NO_MODULE)

include(${VTK_USE_FILE})

add_subdirectory(../ouster_client ouster_client EXCLUDE_FROM_ALL)

include_directories(include)

Expand Down
4 changes: 0 additions & 4 deletions ouster_viz/src/viz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
#include <vtkSmartPointer.h>
#include <vtkTransform.h>

#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL);
VTK_MODULE_INIT(vtkInteractionStyle)

#include "ouster/colormaps.h"
#include "ouster/lidar_scan.h"
#include "ouster/viz.h"
Expand Down

0 comments on commit fdec975

Please sign in to comment.