From: Alexander Alekhin Date: Wed, 29 Nov 2017 13:52:42 +0000 (+0300) Subject: cmake: fix WITH_VTK usage X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~347^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22c0bb7dc9570416d6c4beec54735b6a58dac495;p=platform%2Fupstream%2Fopencv.git 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_'). --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f73c8c8..4af166d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/cmake/OpenCVDetectVTK.cmake b/cmake/OpenCVDetectVTK.cmake index cf4eb2b..74f075e 100644 --- a/cmake/OpenCVDetectVTK.cmake +++ b/cmake/OpenCVDetectVTK.cmake @@ -1,7 +1,3 @@ -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) diff --git a/modules/viz/CMakeLists.txt b/modules/viz/CMakeLists.txt index a5468c5..3575a0c 100644 --- a/modules/viz/CMakeLists.txt +++ b/modules/viz/CMakeLists.txt @@ -1,4 +1,4 @@ -if(NOT WITH_VTK OR NOT DEFINED HAVE_VTK OR NOT HAVE_VTK) +if(NOT HAVE_VTK) ocv_module_disable(viz) endif()