1 if(NOT WITH_VTK OR ANDROID OR IOS)
6 find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
10 find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
15 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")
19 # Don't support ealier VTKs
20 if(${VTK_VERSION} VERSION_LESS "5.8.0")
21 message(STATUS "VTK support is disabled. VTK ver. 5.8.0 is minimum required, but found VTK ver. ${VTK_VERSION}")
25 # Different Qt versions can't be linked together
26 if(HAVE_QT5 AND ${VTK_VERSION} VERSION_LESS "6.0.0")
28 message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
32 # 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
33 if(HAVE_QT5 AND ${VTK_VERSION} VERSION_EQUAL "6.0.0" AND NOT DEFINED FORCE_VTK)
34 message(STATUS "VTK support is disabled. Possible incompatible combination: OpenCV+Qt5, and VTK ver.${VTK_VERSION} with Qt4")
35 message(STATUS "If it is known that VTK was compiled without Qt4, please define '-DFORCE_VTK=TRUE' flag in CMake")
39 # Different Qt versions can't be linked together
40 if(HAVE_QT AND ${VTK_VERSION} VERSION_GREATER "6.0.0" AND NOT ${VTK_QT_VERSION} STREQUAL "")
41 if(HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "4")
42 message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
46 if(NOT HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "5")
47 message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt4 and VTK ver.${VTK_VERSION} + Qt5")
53 message(STATUS "Found VTK ver. ${VTK_VERSION} (usefile: ${VTK_USE_FILE})")