diff --git a/modules/world/CMakeLists.txt b/modules/world/CMakeLists.txt index 20edbd5733..2f4b1a4eb1 100644 --- a/modules/world/CMakeLists.txt +++ b/modules/world/CMakeLists.txt @@ -59,6 +59,10 @@ ocv_module_include_directories() #message(STATUS "${OPENCV_MODULE_${the_module}_SOURCES}") ocv_create_module(${link_deps}) +if(";${OPENCV_MODULES_BUILD};" MATCHES ";opencv_viz;" AND OPENCV_MODULE_opencv_viz_IS_PART_OF_WORLD AND VTK_VERSION VERSION_GREATER_EQUAL "8.90.0") + vtk_module_autoinit(TARGETS opencv_world MODULES ${VTK_LIBRARIES}) +endif() + ocv_target_compile_definitions(${the_module} PRIVATE OPENCV_MODULE_IS_PART_OF_WORLD=1) if(BUILD_opencv_imgcodecs AND OPENCV_MODULE_opencv_imgcodecs_IS_PART_OF_WORLD)