detect_v4l.cmake 474 B

1234567891011121314151617
  1. # --- V4L ---
  2. if(NOT HAVE_V4L)
  3. set(CMAKE_REQUIRED_QUIET TRUE) # for check_include_file
  4. check_include_file(linux/videodev2.h HAVE_CAMV4L2)
  5. check_include_file(sys/videoio.h HAVE_VIDEOIO)
  6. if(HAVE_CAMV4L2 OR HAVE_VIDEOIO)
  7. set(HAVE_V4L TRUE)
  8. set(defs)
  9. if(HAVE_CAMV4L2)
  10. list(APPEND defs "HAVE_CAMV4L2")
  11. endif()
  12. if(HAVE_VIDEOIO)
  13. list(APPEND defs "HAVE_VIDEOIO")
  14. endif()
  15. ocv_add_external_target(v4l "" "" "${defs}")
  16. endif()
  17. endif()