Merge pull request #2354 from gleb-sternharz:Branch_2.4.8
[platform/upstream/opencv.git] / cmake / OpenCVDetectVTK.cmake
1 if(NOT WITH_VTK OR ANDROID OR IOS)
2   return()
3 endif()
4
5 if (HAVE_QT5)
6   message(STATUS "VTK is disabled because OpenCV is linked with Q5. Some VTK disributives are compiled with Q4 and therefore can't be linked together Qt5.")
7   return()
8 endif()
9
10 find_package(VTK 6.0 QUIET COMPONENTS vtkRenderingCore vtkInteractionWidgets vtkInteractionStyle vtkIOLegacy vtkIOPLY vtkRenderingFreeType vtkRenderingLOD vtkFiltersTexture vtkIOExport NO_MODULE)
11
12 if(NOT DEFINED VTK_FOUND OR NOT VTK_FOUND)
13   find_package(VTK 5.10 QUIET COMPONENTS vtkCommon vtkFiltering vtkRendering vtkWidgets vtkImaging NO_MODULE)
14 endif()
15
16 if(NOT DEFINED VTK_FOUND OR NOT VTK_FOUND)
17   find_package(VTK 5.8 QUIET COMPONENTS vtkCommon vtkFiltering vtkRendering vtkWidgets vtkImaging NO_MODULE)
18 endif()
19
20 if(VTK_FOUND)
21   set(HAVE_VTK ON)
22   message(STATUS "Found VTK ver. ${VTK_VERSION} (usefile: ${VTK_USE_FILE})")
23 else()
24   set(HAVE_VTK OFF)
25   message(STATUS "VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or set $VTK_DIR enviroment variable to VTK install subdirectory with VTKConfig.cmake file (for windows)")
26 endif()