Commit e91a991a authored by Aaron Bray's avatar Aaron Bray
Browse files

Changes for upgrading to VTK 8.9

parent 91df18b7
......@@ -81,6 +81,7 @@ ExternalProject_Add( ${PROJECT_NAME}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${${PROJECT_NAME}_SOURCE_DIR}
BINARY_DIR ${CMAKE_BINARY_DIR}/Innerbuild
${COMMON_CMAKE_EP_ARGS}
CMAKE_ARGS
-DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-DBUILD_TESTING:BOOL=${BUILD_TESTING}
......
......@@ -20,18 +20,17 @@ imstk_add_external_project( VTK
-DBUILD_TESTING:BOOL=OFF
-DVTK_Group_StandAlone:BOOL=OFF
-DVTK_Group_Rendering:BOOL=OFF
-DModule_vtkRenderingOpenGL2:BOOL=ON
-DModule_vtkIOXML:BOOL=ON
-DModule_vtkIOLegacy:BOOL=ON
-DModule_vtkIOPLY:BOOL=ON
-DModule_vtkIOGeometry:BOOL=ON
-DModule_vtkInteractionStyle:BOOL=ON
-DModule_vtkRenderingAnnotation:BOOL=ON
-DModule_vtkRenderingOpenVR:BOOL=${${PROJECT_NAME}_ENABLE_VR}
-DVTK_MODULE_ENABLE_VTK_RenderingOpenGL2:STRING=YES
-DVTK_MODULE_ENABLE_VTK_IOXML:STRING=YES
-DVTK_MODULE_ENABLE_VTK_IOLegacy:STRING=YES
-DVTK_MODULE_ENABLE_VTK_IOPLY:STRING=YES
-DVTK_MODULE_ENABLE_VTK_IOGeometry:STRING=YES
-DVTK_MODULE_ENABLE_VTK_InteractionStyle:STRING=YES
-DVTK_MODULE_ENABLE_VTK_RenderingAnnotation:STRING=YES
-DVTK_MODULE_ENABLE_VTK_RenderingOpenVR:STRING=${VTK_ENABLE_OPENVR}
-DModule_vtkInteractionWidgets:BOOL=ON
-DModule_vtkglew:BOOL=ON
-DModule_vtkRenderingContext2D:BOOL=ON
-DVTK_MODULE_ENABLE_VTK_InteractionWidgets:STRING=YES
-DVTK_MODULE_ENABLE_VTK_glew:STRING=YES
-DVTK_MODULE_ENABLE_VTK_RenderingContext2D:STRING=YES
-DVTK_RENDERING_BACKEND:STRING=OpenGL2
-DVTK_WRAP_PYTHON:BOOL=OFF
-DVTK_OPENVR_OBJECT_FACTORY:BOOL=OFF
......
......@@ -78,7 +78,7 @@ macro(imstk_add_external_project extProj)
# If needs to download and build
#-----------------------------------------------------------------------------
if(NOT DEFINED ${extProj}_DIR AND NOT ${USE_SYSTEM_${extProj}})
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Ensure all generator info is passed to external library build
#-----------------------------------------------------------------------------
set (COMMON_CMAKE_EP_ARGS
......
......@@ -235,8 +235,31 @@ else()
endif()
# VTK
find_package( VTK REQUIRED CONFIG )
include( ${VTK_USE_FILE} )
find_package(VTK CONFIG)
if (VTK_VERSION VERSION_LESS "8.90")
# Modules are linked via `vtkCommonCore`
# VTK_DEFINITIONS has autoinit information
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
else()
# modules are linked via `VTK::CommonCore`
# vtk_module_autoinit is needed
find_package(VTK COMPONENTS
CommonCore
FiltersGeneral
FiltersSources
ImagingCore
InteractionStyle
IOExport
IOImport
IOParallel
IOParallelXML
IOPLY
RenderingCore
RenderingAnnotation
RenderingOpenGL2
)
endif()
# Vulkan
set(Vulkan "") # Target name for dependencies
......
......@@ -22,6 +22,7 @@ project(Example-Rendering)
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} RenderingExample.cpp)
vtk_module_autoinit(TARGETS ${PROJECT_NAME} MODULES ${VTK_LIBRARIES})
#-----------------------------------------------------------------------------
# Add the target to Examples folder
......
......@@ -22,6 +22,7 @@ project(Example-Viewer)
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} ViewerExample.cpp)
vtk_module_autoinit(TARGETS ${PROJECT_NAME} MODULES ${VTK_LIBRARIES})
#-----------------------------------------------------------------------------
# Add the target to Examples folder
......
......@@ -50,7 +50,7 @@ main()
// Add spot light (red)
auto colorLight = std::make_shared<SpotLight>("colorLight");
colorLight->setPosition(Vec3d(4, 3, 1));
colorLight->setFocalPoint(Vec3d(0, 0, 0));
colorLight->setFocalPoint(Vec3d(0, 0.25, 0));
colorLight->setColor(Color::Red);
colorLight->setIntensity(100);
colorLight->setSpotAngle(1);
......
......@@ -10,7 +10,6 @@ imstk_add_library( Geometry
glm
Assimp
VegaFEM::volumetricMesh
${VTK_LIBRARIES}
)
#-----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment