<commit_before>macro(find_qvtk)
  find_library (QVTK_LIBRARY QVTK HINTS ${VTK_DIR} ${VTK_DIR}/bin)
  find_path (QVTK_INCLUDE_DIR QVTKWidget.h HINT ${VTK_INCLUDE_DIRS})
  find_package_handle_standard_args(QVTK DEFAULT_MSG QVTK_LIBRARY QVTK_INCLUDE_DIR)

  if(QVTK_FOUND)   
    get_filename_component (QVTK_LIBRARY_DIR ${QVTK_LIBRARY} PATH)
    list(APPEND VTK_LIBRARY_DIRS ${QVTK_LIBRARY_DIR})
    list(APPEND VTK_INCLUDE_DIRS ${QVTK_INCLUDE_DIR})
    set (VTK_USE_QVTK ON)
  endif()
endmacro()

macro(find_vtk)
  find_package(VTK 5.10.0 REQUIRED)
  if(NOT VTK_FOUND)
    find_package(VTK 6.0.0 REQUIRED)
  endif()
  if(VTK_FOUND)
    if (BUILD_SHARED_LIBS OR (NOT BUILD_SHARED_LIBS AND NOT VTK_BUILD_SHARED_LIBS))
      find_qvtk()
      message(STATUS "VTK found (include: ${VTK_INCLUDE_DIRS}, lib: ${VTK_LIBRARY_DIRS})")
      link_directories(${VTK_LIBRARY_DIRS})
      include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
      set(HAVE_VTK ON)    
    else ()
      set(HAVE_VTK OFF)
      message (FATAL_ERROR "VTK disabled. You are to build OpenCV in STATIC but VTK is SHARED!")
    endif ()
  endif()
endmacro()

if (NOT OPENCV_INITIAL_PASS AND DEFINED BUILD_opencv_viz AND BUILD_opencv_viz)
  find_vtk()
endif()

if(DEFINED HAVE_VTK AND HAVE_VTK)
  set(VTK_USE_FILE ${VTK_USE_FILE} CACHE INTERNAL "VTK_USE_FILE")<commit_msg>check if vtk 5.10.0 exists, if not require 6.0.0<commit_after>macro(find_qvtk)
  find_library (QVTK_LIBRARY QVTK HINTS ${VTK_DIR} ${VTK_DIR}/bin)
  find_path (QVTK_INCLUDE_DIR QVTKWidget.h HINT ${VTK_INCLUDE_DIRS})
  find_package_handle_standard_args(QVTK DEFAULT_MSG QVTK_LIBRARY QVTK_INCLUDE_DIR)

  if(QVTK_FOUND)   
    get_filename_component (QVTK_LIBRARY_DIR ${QVTK_LIBRARY} PATH)
    list(APPEND VTK_LIBRARY_DIRS ${QVTK_LIBRARY_DIR})
    list(APPEND VTK_INCLUDE_DIRS ${QVTK_INCLUDE_DIR})
    set (VTK_USE_QVTK ON)
  endif()
endmacro()

macro(find_vtk)
  find_package(VTK 5.10.0)
  if(NOT VTK_FOUND)
    find_package(VTK 6.0.0 REQUIRED)
  endif()
  if(VTK_FOUND)
    if (BUILD_SHARED_LIBS OR (NOT BUILD_SHARED_LIBS AND NOT VTK_BUILD_SHARED_LIBS))
      find_qvtk()
      message(STATUS "VTK found (include: ${VTK_INCLUDE_DIRS}, lib: ${VTK_LIBRARY_DIRS})")
      link_directories(${VTK_LIBRARY_DIRS})
      include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
      set(HAVE_VTK ON)    
    else ()
      set(HAVE_VTK OFF)
      message (FATAL_ERROR "VTK disabled. You are to build OpenCV in STATIC but VTK is SHARED!")
    endif ()
  endif()
endmacro()

if (NOT OPENCV_INITIAL_PASS AND DEFINED BUILD_opencv_viz AND BUILD_opencv_viz)
  find_vtk()
endif()

if(DEFINED HAVE_VTK AND HAVE_VTK)
  set(VTK_USE_FILE ${VTK_USE_FILE} CACHE INTERNAL "VTK_USE_FILE")
{'fraction_non_alphanumeric': 0.09500745156482861, 'fraction_numerical': 0.00782414307004471, 'mean_word_length': 4.91409691629956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7190262', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1133, 'n_words': 214}