Merge pull request #20384 from rogday:find_package_cache

pull/20503/head
Alexander Alekhin 3 years ago
commit da07ad16c1
  1. 60
      cmake/OpenCVDetectVTK.cmake

@ -1,34 +1,34 @@
# VTK 9.0
if(NOT VTK_FOUND) if(NOT VTK_FOUND)
find_package(VTK 9 QUIET NAMES vtk COMPONENTS find_package(VTK QUIET NAMES vtk VTK)
FiltersExtraction if(VTK_FOUND)
FiltersSources if(VTK_VERSION VERSION_EQUAL "9") # VTK 9.0
FiltersTexture find_package(VTK 9 QUIET NAMES vtk COMPONENTS
IOExport FiltersExtraction
IOGeometry FiltersSources
IOPLY FiltersTexture
InteractionStyle IOExport
RenderingCore IOGeometry
RenderingLOD IOPLY
RenderingOpenGL2 InteractionStyle
NO_MODULE) RenderingCore
endif() RenderingLOD
RenderingOpenGL2
# VTK 6.x components NO_MODULE)
if(NOT VTK_FOUND) elseif(VTK_VERSION VERSION_GREATER "5") # VTK 6.x components
find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE) find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
IF(VTK_FOUND) IF(VTK_FOUND)
IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var. 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) 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) find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
ENDIF(VTK_RENDERING_BACKEND) ENDIF(VTK_RENDERING_BACKEND)
ENDIF(VTK_FOUND) ENDIF(VTK_FOUND)
endif() elseif(VTK_VERSION VERSION_EQUAL "5") # VTK 5.x components
find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
# VTK 5.x components else()
if(NOT VTK_FOUND) set(VTK_FOUND FALSE)
find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE) endif()
endif()
endif() endif()
if(NOT VTK_FOUND) if(NOT VTK_FOUND)

Loading…
Cancel
Save