2 find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
4 IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
5 find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE)
6 ELSE(VTK_RENDERING_BACKEND)
7 find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
8 ENDIF(VTK_RENDERING_BACKEND)
13 find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
18 message(STATUS "VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file")
22 # Don't support earlier VTKs
23 if(VTK_VERSION VERSION_LESS "5.8.0")
24 message(STATUS "VTK support is disabled. VTK ver. 5.8.0 is minimum required, but found VTK ver. ${VTK_VERSION}")
28 # Different Qt versions can't be linked together
29 if(HAVE_QT5 AND VTK_VERSION VERSION_LESS "6.0.0")
31 message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
35 # Different Qt versions can't be linked together. VTK 6.0.0 doesn't provide a way to get Qt version it was linked with
36 if(HAVE_QT5 AND VTK_VERSION VERSION_EQUAL "6.0.0" AND NOT DEFINED FORCE_VTK)
37 message(STATUS "VTK support is disabled. Possible incompatible combination: OpenCV+Qt5, and VTK ver.${VTK_VERSION} with Qt4")
38 message(STATUS "If it is known that VTK was compiled without Qt4, please define '-DFORCE_VTK=TRUE' flag in CMake")
42 # Different Qt versions can't be linked together
43 if(HAVE_QT AND VTK_VERSION VERSION_GREATER "6.0.0" AND NOT ${VTK_QT_VERSION} STREQUAL "")
44 if(HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "4")
45 message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
49 if(NOT HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "5")
50 message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt4 and VTK ver.${VTK_VERSION} + Qt5")
56 message(STATUS "Found VTK ${VTK_VERSION} (${VTK_USE_FILE})")