CMakeLists.txt 723 B

123456789101112131415161718192021222324
  1. ocv_install_example_src(dnn *.cpp *.hpp CMakeLists.txt)
  2. set(OPENCV_DNN_SAMPLES_REQUIRED_DEPS
  3. opencv_core
  4. opencv_imgproc
  5. opencv_dnn
  6. opencv_objdetect
  7. opencv_video
  8. opencv_imgcodecs
  9. opencv_videoio
  10. opencv_highgui)
  11. ocv_check_dependencies(${OPENCV_DNN_SAMPLES_REQUIRED_DEPS})
  12. if(NOT BUILD_EXAMPLES OR NOT OCV_DEPENDENCIES_FOUND)
  13. return()
  14. endif()
  15. project(dnn_samples)
  16. ocv_include_modules_recurse(${OPENCV_DNN_SAMPLES_REQUIRED_DEPS})
  17. file(GLOB_RECURSE dnn_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
  18. foreach(sample_filename ${dnn_samples})
  19. ocv_define_sample(tgt ${sample_filename} dnn)
  20. ocv_target_link_libraries(${tgt} PRIVATE ${OPENCV_LINKER_LIBS} ${OPENCV_DNN_SAMPLES_REQUIRED_DEPS})
  21. endforeach()