Skip to content

Commit 22c0bb7

Browse files
committed
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_').
1 parent b19f81b commit 22c0bb7

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,9 @@ if(WITH_MATLAB)
656656
include(cmake/OpenCVFindMatlab.cmake)
657657
endif()
658658

659-
include(cmake/OpenCVDetectVTK.cmake)
659+
if(WITH_VTK)
660+
include(cmake/OpenCVDetectVTK.cmake)
661+
endif()
660662

661663
if(WITH_OPENVX)
662664
include(cmake/FindOpenVX.cmake)

cmake/OpenCVDetectVTK.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
if(NOT WITH_VTK)
2-
return()
3-
endif()
4-
51
# VTK 6.x components
62
find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
73
IF(VTK_FOUND)

modules/viz/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if(NOT WITH_VTK OR NOT DEFINED HAVE_VTK OR NOT HAVE_VTK)
1+
if(NOT HAVE_VTK)
22
ocv_module_disable(viz)
33
endif()
44

0 commit comments

Comments
 (0)