aboutsummaryrefslogtreecommitdiff
path: root/ports/opencv4/0006-fix-vtk9.patch
blob: 7942b0aa4d8b43c40fcaddd462664c2a7372c0eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/cmake/OpenCVDetectVTK.cmake b/cmake/OpenCVDetectVTK.cmake
index 0f2b958..4c83504 100644
--- a/cmake/OpenCVDetectVTK.cmake
+++ b/cmake/OpenCVDetectVTK.cmake
@@ -1,12 +1,30 @@
+# VTK 9.0
+if(NOT VTK_FOUND)
+  find_package(VTK 9 QUIET NAMES vtk COMPONENTS
+    FiltersExtraction
+    FiltersSources
+    FiltersTexture
+    IOExport
+    IOGeometry
+    IOPLY
+    InteractionStyle
+    RenderingCore
+    RenderingLOD
+    RenderingOpenGL2
+    NO_MODULE)
+endif()
+
 # VTK 6.x components
-find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
-IF(VTK_FOUND)
-  IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
+if(NOT VTK_FOUND)
+  find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
+  IF(VTK_FOUND)
+    IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
       find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE)
-  ELSE(VTK_RENDERING_BACKEND)
+    ELSE(VTK_RENDERING_BACKEND)
       find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
-  ENDIF(VTK_RENDERING_BACKEND)
-ENDIF(VTK_FOUND)
+    ENDIF(VTK_RENDERING_BACKEND)
+  ENDIF(VTK_FOUND)
+endif()
 
 # VTK 5.x components
 if(NOT VTK_FOUND)