2014-09-10 04:47:50 -07:00
|
|
|
project(linux-v4l2)
|
|
|
|
|
|
|
|
if(DISABLE_V4L2)
|
|
|
|
message(STATUS "v4l2 plugin disabled")
|
|
|
|
return()
|
|
|
|
endif()
|
2014-03-11 11:33:04 -07:00
|
|
|
|
2014-10-14 14:32:52 -07:00
|
|
|
|
2020-04-03 20:56:48 -07:00
|
|
|
if(ENABLE_V4L2)
|
|
|
|
find_package(Libv4l2 REQUIRED)
|
|
|
|
else()
|
|
|
|
find_package(Libv4l2)
|
|
|
|
if(NOT LIBV4L2_FOUND)
|
|
|
|
message(STATUS "libv4l2 not found, disabling v4l2 plugin")
|
|
|
|
return()
|
|
|
|
endif()
|
2014-07-23 13:18:01 -07:00
|
|
|
endif()
|
|
|
|
|
2020-04-03 20:56:48 -07:00
|
|
|
if(DISABLE_UDEV)
|
2020-05-21 00:03:09 -07:00
|
|
|
add_definitions(-DHAVE_UDEV)
|
2020-04-03 20:56:48 -07:00
|
|
|
else()
|
|
|
|
find_package(UDev)
|
|
|
|
if(NOT UDEV_FOUND)
|
|
|
|
message(STATUS "udev disabled for v4l2 plugin")
|
|
|
|
else()
|
|
|
|
set(linux-v4l2-udev_SOURCES
|
|
|
|
v4l2-udev.c
|
|
|
|
)
|
|
|
|
endif()
|
2014-10-14 14:32:52 -07:00
|
|
|
endif()
|
|
|
|
|
2015-05-03 08:09:29 -07:00
|
|
|
include_directories(
|
|
|
|
SYSTEM "${CMAKE_SOURCE_DIR}/libobs"
|
|
|
|
${LIBV4L2_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2014-03-11 11:33:04 -07:00
|
|
|
set(linux-v4l2_SOURCES
|
|
|
|
linux-v4l2.c
|
2019-03-16 21:15:44 -07:00
|
|
|
v4l2-controls.c
|
2014-03-11 11:33:04 -07:00
|
|
|
v4l2-input.c
|
2014-08-10 08:33:03 -07:00
|
|
|
v4l2-helpers.c
|
2020-07-18 00:03:38 -07:00
|
|
|
v4l2-output.c
|
2014-10-14 14:32:52 -07:00
|
|
|
${linux-v4l2-udev_SOURCES}
|
2014-03-11 11:33:04 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(linux-v4l2 MODULE
|
|
|
|
${linux-v4l2_SOURCES}
|
|
|
|
)
|
|
|
|
target_link_libraries(linux-v4l2
|
|
|
|
libobs
|
2014-07-23 13:18:01 -07:00
|
|
|
${LIBV4L2_LIBRARIES}
|
2014-10-14 14:32:52 -07:00
|
|
|
${UDEV_LIBRARIES}
|
2014-03-11 11:33:04 -07:00
|
|
|
)
|
2020-05-13 06:37:01 -07:00
|
|
|
set_target_properties(linux-v4l2 PROPERTIES FOLDER "plugins")
|
2014-03-11 11:33:04 -07:00
|
|
|
|
2014-08-19 05:24:59 -07:00
|
|
|
install_obs_plugin_with_data(linux-v4l2 data)
|