CMakeLists.txt 819 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. project(linux-v4l2)
  2. if(DISABLE_V4L2)
  3. message(STATUS "v4l2 plugin disabled")
  4. return()
  5. endif()
  6. find_package(Libv4l2)
  7. find_package(LibUDev QUIET)
  8. if(NOT LIBV4L2_FOUND AND ENABLE_V4L2)
  9. message(FATAL_ERROR "libv4l2 not found bit plugin set as enabled")
  10. elseif(NOT LIBV4L2_FOUND)
  11. message(STATUS "libv4l2 not found, disabling v4l2 plugin")
  12. return()
  13. endif()
  14. if(NOT UDEV_FOUND OR DISABLE_UDEV)
  15. message(STATUS "udev disabled for v4l2 plugin")
  16. else()
  17. set(linux-v4l2-udev_SOURCES
  18. v4l2-udev.c
  19. )
  20. add_definitions(-DHAVE_UDEV)
  21. endif()
  22. set(linux-v4l2_SOURCES
  23. linux-v4l2.c
  24. v4l2-input.c
  25. v4l2-helpers.c
  26. ${linux-v4l2-udev_SOURCES}
  27. )
  28. add_library(linux-v4l2 MODULE
  29. ${linux-v4l2_SOURCES}
  30. )
  31. target_link_libraries(linux-v4l2
  32. libobs
  33. ${LIBV4L2_LIBRARIES}
  34. ${UDEV_LIBRARIES}
  35. )
  36. install_obs_plugin_with_data(linux-v4l2 data)