<commit_before>SET(OPENCV_GPU_SAMPLES_REQUIRED_DEPS opencv_core opencv_flann opencv_imgproc opencv_highgui
                                     opencv_ml opencv_video opencv_objdetect opencv_features2d
                                     opencv_calib3d opencv_legacy opencv_contrib opencv_gpu
                                     opencv_superres)
ocv_check_dependencies(${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})

if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
  set(project "gpu")
  string(TOUPPER "${project}" project_upper)

  project("${project}_samples")

  ocv_include_modules(${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})
  ocv_include_directories(
    "${OpenCV_SOURCE_DIR}/modules/gpu/src/nvidia"
    "${OpenCV_SOURCE_DIR}/modules/gpu/src/nvidia/core"
    )

  if(HAVE_opencv_nonfree)
    ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/nonfree/include")
  endif()

  if(HAVE_CUDA)
    ocv_include_directories(${CUDA_INCLUDE_DIRS})
  endif()

  if(HAVE_OPENCL)
    ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/ocl/include")
  endif()

  if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
  endif()

  # ---------------------------------------------
  #      Define executable targets
  # ---------------------------------------------
  MACRO(OPENCV_DEFINE_GPU_EXAMPLE name srcs)
    set(the_target "example_${project}_${name}")
    add_executable(${the_target} ${srcs})

    target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})
    if(HAVE_opencv_nonfree)
      target_link_libraries(${the_target} opencv_nonfree)
    endif()

    if(HAVE_OPENCL)
      target_link_libraries(${the_target} opencv_ocl)
    endif()

    set_target_properties(${the_target} PROPERTIES
      OUTPUT_NAME "${project}-example-${name}"
      PROJECT_LABEL "(EXAMPLE_${project_upper}) ${name}")

    if(ENABLE_SOLUTION_FOLDERS)
      set_target_properties(${the_target} PROPERTIES FOLDER "samples//${project}")
    endif()

    if(WIN32)<commit_msg>fix for bug #3219 (undefined reference in GPU samples)<commit_after>SET(OPENCV_GPU_SAMPLES_REQUIRED_DEPS opencv_core opencv_flann opencv_imgproc opencv_highgui
                                     opencv_ml opencv_video opencv_objdetect opencv_features2d
                                     opencv_calib3d opencv_legacy opencv_contrib opencv_gpu
                                     opencv_superres)
ocv_check_dependencies(${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})

if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
  set(project "gpu")
  string(TOUPPER "${project}" project_upper)

  project("${project}_samples")

  ocv_include_modules(${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})
  ocv_include_directories(
    "${OpenCV_SOURCE_DIR}/modules/gpu/src/nvidia"
    "${OpenCV_SOURCE_DIR}/modules/gpu/src/nvidia/core"
    )

  if(HAVE_opencv_nonfree)
    ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/nonfree/include")
  endif()

  if(HAVE_CUDA)
    ocv_include_directories(${CUDA_INCLUDE_DIRS})
  endif()

  if(HAVE_OPENCL)
    ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/ocl/include")
  endif()

  if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
  endif()

  # ---------------------------------------------
  #      Define executable targets
  # ---------------------------------------------
  MACRO(OPENCV_DEFINE_GPU_EXAMPLE name srcs)
    set(the_target "example_${project}_${name}")
    add_executable(${the_target} ${srcs})

    target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})

    if(HAVE_CUDA)
      target_link_libraries(${the_target} ${CUDA_CUDA_LIBRARY})
    endif()

    if(HAVE_opencv_nonfree)
      target_link_libraries(${the_target} opencv_nonfree)
    endif()

    if(HAVE_OPENCL)
      target_link_libraries(${the_target} opencv_ocl)
    endif()

    set_target_properties(${the_target} PROPERTIES
      OUTPUT_NAME "${project}-example-${name}"
      PROJECT_LABEL "(EXAMPLE_${project_upper}) ${name}")

    if(ENABLE_SOLUTION_FOLDERS)
      set_target_properties(${the_target} PROPERTIES FOLDER "samples//${project}")
    endif()

    if(WIN32)
{'fraction_non_alphanumeric': 0.14164104989359186, 'fraction_numerical': 0.0028375502482856467, 'mean_word_length': 3.4386149003147954, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7558456', 'n_tokens_mistral': 1553, 'n_tokens_neox': 1461, 'n_words': 171}