Commit 22c0bb7d authored by Alexander Alekhin's avatar Alexander Alekhin Committed by Alexander Alekhin

cmake: fix WITH_VTK usage

'WITH_' variables is intended to enable CMake scripts with some autodetection logic.
'WITH_' can be off, but components is really enabled via command-line options
with proper variables setup (including 'HAVE_').
parent b19f81b3
......@@ -656,7 +656,9 @@ if(WITH_MATLAB)
include(cmake/OpenCVFindMatlab.cmake)
endif()
include(cmake/OpenCVDetectVTK.cmake)
if(WITH_VTK)
include(cmake/OpenCVDetectVTK.cmake)
endif()
if(WITH_OPENVX)
include(cmake/FindOpenVX.cmake)
......
if(NOT WITH_VTK)
return()
endif()
# VTK 6.x components
find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
IF(VTK_FOUND)
......
if(NOT WITH_VTK OR NOT DEFINED HAVE_VTK OR NOT HAVE_VTK)
if(NOT HAVE_VTK)
ocv_module_disable(viz)
endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment