diff --git a/CMake/PackageDepends/MITK_VTK_Config.cmake b/CMake/PackageDepends/MITK_VTK_Config.cmake index e81aee00b9..9ba1798589 100644 --- a/CMake/PackageDepends/MITK_VTK_Config.cmake +++ b/CMake/PackageDepends/MITK_VTK_Config.cmake @@ -1,12 +1,9 @@ find_package(VTK COMPONENTS ${VTK_REQUIRED_COMPONENTS_BY_MODULE} REQUIRED) -if(VTK_FOUND AND NOT VTK_BUILD_SHARED_LIBS) - message(FATAL_ERROR "MITK only supports a VTK which was built with shared libraries. Turn on BUILD_SHARED_LIBS in your VTK config.") -endif() if(MITK_USE_Qt5) find_package(Qt5Widgets REQUIRED QUIET) endif() list(APPEND ALL_INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS}) list(APPEND ALL_LIBRARIES ${VTK_LIBRARIES}) list(APPEND ALL_COMPILE_DEFINITIONS ${VTK_DEFINITIONS}) diff --git a/CMakeExternals/VTK-8.1.0.patch b/CMakeExternals/VTK-8.1.0.patch deleted file mode 100644 index 2082d02688..0000000000 --- a/CMakeExternals/VTK-8.1.0.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/Rendering/Core/vtkAssembly.cxx b/Rendering/Core/vtkAssembly.cxx -index 79e4d42b65..b17c74e659 100644 ---- a/Rendering/Core/vtkAssembly.cxx -+++ b/Rendering/Core/vtkAssembly.cxx -@@ -116,6 +116,7 @@ int vtkAssembly::RenderTranslucentPolygonalGeometry(vtkViewport *ren) - vtkProp3D* prop3D = static_cast(path->GetLastNode()->GetViewProp()); - if ( prop3D->GetVisibility() ) - { -+ prop3D->SetPropertyKeys(this->GetPropertyKeys()); - prop3D->SetAllocatedRenderTime(fraction, ren); - prop3D->PokeMatrix(path->GetLastNode()->GetMatrix()); - renderedSomething += prop3D->RenderTranslucentPolygonalGeometry(ren); -@@ -143,6 +144,7 @@ int vtkAssembly::HasTranslucentPolygonalGeometry() - vtkProp3D* prop3D = static_cast(path->GetLastNode()->GetViewProp()); - if ( prop3D->GetVisibility() ) - { -+ prop3D->SetPropertyKeys(this->GetPropertyKeys()); - result = prop3D->HasTranslucentPolygonalGeometry(); - } - } -@@ -175,6 +177,7 @@ int vtkAssembly::RenderVolumetricGeometry(vtkViewport *ren) - vtkProp3D* prop3D = static_cast(path->GetLastNode()->GetViewProp()); - if (prop3D->GetVisibility()) - { -+ prop3D->SetPropertyKeys(this->GetPropertyKeys()); - prop3D->SetAllocatedRenderTime(fraction, ren); - prop3D->PokeMatrix(path->GetLastNode()->GetMatrix()); - renderedSomething += prop3D->RenderVolumetricGeometry(ren); -@@ -210,6 +213,7 @@ int vtkAssembly::RenderOpaqueGeometry(vtkViewport *ren) - vtkProp3D* prop3D = static_cast(path->GetLastNode()->GetViewProp()); - if (prop3D->GetVisibility()) - { -+ prop3D->SetPropertyKeys(this->GetPropertyKeys()); - prop3D->PokeMatrix(path->GetLastNode()->GetMatrix()); - prop3D->SetAllocatedRenderTime(fraction, ren); - renderedSomething += prop3D->RenderOpaqueGeometry(ren); -diff --git a/Rendering/Core/vtkPropAssembly.cxx b/Rendering/Core/vtkPropAssembly.cxx -index 5033c3b66e..405b1a75ab 100644 ---- a/Rendering/Core/vtkPropAssembly.cxx -+++ b/Rendering/Core/vtkPropAssembly.cxx -@@ -97,6 +97,7 @@ int vtkPropAssembly::RenderTranslucentPolygonalGeometry(vtkViewport *ren) - prop = path->GetLastNode()->GetViewProp(); - if ( prop->GetVisibility() ) - { -+ prop->SetPropertyKeys(this->GetPropertyKeys()); - prop->SetAllocatedRenderTime(fraction, ren); - prop->PokeMatrix(path->GetLastNode()->GetMatrix()); - renderedSomething += prop->RenderTranslucentPolygonalGeometry(ren); -@@ -125,6 +126,7 @@ int vtkPropAssembly::HasTranslucentPolygonalGeometry() - prop = path->GetLastNode()->GetViewProp(); - if ( prop->GetVisibility() ) - { -+ prop->SetPropertyKeys(this->GetPropertyKeys()); - result=prop->HasTranslucentPolygonalGeometry(); - } - } -@@ -154,6 +156,7 @@ int vtkPropAssembly::RenderVolumetricGeometry(vtkViewport *ren) - prop = path->GetLastNode()->GetViewProp(); - if ( prop->GetVisibility() ) - { -+ prop->SetPropertyKeys(this->GetPropertyKeys()); - prop->SetAllocatedRenderTime(fraction, ren); - prop->PokeMatrix(path->GetLastNode()->GetMatrix()); - renderedSomething += prop->RenderVolumetricGeometry(ren); -@@ -186,6 +189,7 @@ int vtkPropAssembly::RenderOpaqueGeometry(vtkViewport *ren) - prop = path->GetLastNode()->GetViewProp(); - if ( prop->GetVisibility() ) - { -+ prop->SetPropertyKeys(this->GetPropertyKeys()); - prop->SetAllocatedRenderTime(fraction, ren); - prop->PokeMatrix(path->GetLastNode()->GetMatrix()); - renderedSomething += prop->RenderOpaqueGeometry(ren); -@@ -217,6 +221,7 @@ int vtkPropAssembly::RenderOverlay(vtkViewport *ren) - prop = path->GetLastNode()->GetViewProp(); - if ( prop->GetVisibility() ) - { -+ prop->SetPropertyKeys(this->GetPropertyKeys()); - prop->SetAllocatedRenderTime(fraction, ren); - prop->PokeMatrix(path->GetLastNode()->GetMatrix()); - renderedSomething += prop->RenderOverlay(ren); diff --git a/CMakeExternals/VTK.cmake b/CMakeExternals/VTK.cmake index 5000b167c7..d7e49160e6 100644 --- a/CMakeExternals/VTK.cmake +++ b/CMakeExternals/VTK.cmake @@ -1,89 +1,85 @@ #----------------------------------------------------------------------------- # VTK #----------------------------------------------------------------------------- -if(WIN32) - option(VTK_USE_SYSTEM_FREETYPE OFF) -else() - option(VTK_USE_SYSTEM_FREETYPE ON) -endif() - # Sanity checks if(DEFINED VTK_DIR AND NOT EXISTS ${VTK_DIR}) message(FATAL_ERROR "VTK_DIR variable is defined but corresponds to non-existing directory") endif() set(proj VTK) set(proj_DEPENDENCIES ) set(VTK_DEPENDS ${proj}) if(MITK_USE_HDF5) list(APPEND proj_DEPENDENCIES HDF5) endif() if(NOT DEFINED VTK_DIR) set(additional_cmake_args ) + if(WIN32) + list(APPEND additional_cmake_args + -DCMAKE_CXX_MP_FLAG:BOOL=ON + ) + else() + list(APPEND additional_cmake_args + -DVTK_MODULE_USE_EXTERNAL_VTK_freetype:BOOL=ON + ) + endif() + # Optionally enable memory leak checks for any objects derived from vtkObject. This # will force unit tests to fail if they have any of these memory leaks. option(MITK_VTK_DEBUG_LEAKS OFF) mark_as_advanced(MITK_VTK_DEBUG_LEAKS) list(APPEND additional_cmake_args -DVTK_DEBUG_LEAKS:BOOL=${MITK_VTK_DEBUG_LEAKS} - -DVTK_WRAP_PYTHON:BOOL=OFF - -DVTK_WINDOWS_PYTHON_DEBUGGABLE:BOOL=OFF ) if(MITK_USE_Qt5) list(APPEND additional_cmake_args - -DVTK_Group_Qt:BOOL=ON + -DVTK_GROUP_ENABLE_Qt:STRING=YES -DQt5_DIR:PATH=${Qt5_DIR} ) endif() if(CTEST_USE_LAUNCHERS) list(APPEND additional_cmake_args "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake" ) endif() - - set (VTK_PATCH_OPTION - PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_LIST_DIR}/VTK-8.1.0.patch) mitk_query_custom_ep_vars() ExternalProject_Add(${proj} LIST_SEPARATOR ${sep} - URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/VTK-8.1.0.tar.gz - URL_MD5 4fa5eadbc8723ba0b8d203f05376d932 - ${VTK_PATCH_OPTION} + URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/VTK-9.0.0.tar.gz + URL_MD5 fa61cd36491d89a17edab18522bdda49 CMAKE_GENERATOR ${gen} CMAKE_GENERATOR_PLATFORM ${gen_platform} CMAKE_ARGS ${ep_common_args} - -DVTK_WRAP_TCL:BOOL=OFF - -DVTK_WRAP_PYTHON:BOOL=OFF - -DVTK_WRAP_JAVA:BOOL=OFF - -DVTK_USE_SYSTEM_FREETYPE:BOOL=${VTK_USE_SYSTEM_FREETYPE} + -DVTK_ENABLE_WRAPPING:BOOL=OFF -DVTK_LEGACY_REMOVE:BOOL=ON - -DModule_vtkTestingRendering:BOOL=ON + -DVTK_MODULE_ENABLE_VTK_TestingRendering:STRING=YES + -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2:STRING=YES ${additional_cmake_args} ${${proj}_CUSTOM_CMAKE_ARGS} CMAKE_CACHE_ARGS ${ep_common_cache_args} ${${proj}_CUSTOM_CMAKE_CACHE_ARGS} CMAKE_CACHE_DEFAULT_ARGS ${ep_common_cache_default_args} ${${proj}_CUSTOM_CMAKE_CACHE_DEFAULT_ARGS} DEPENDS ${proj_DEPENDENCIES} ) set(VTK_DIR ${ep_prefix}) mitkFunctionInstallExternalCMakeProject(${proj}) else() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") endif()