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-07-23 13:18:01 -07:00
|
|
|
find_package(Libv4l2)
|
2014-10-14 14:32:52 -07:00
|
|
|
find_package(LibUDev QUIET)
|
|
|
|
|
2014-09-10 04:47:50 -07:00
|
|
|
if(NOT LIBV4L2_FOUND AND ENABLE_V4L2)
|
|
|
|
message(FATAL_ERROR "libv4l2 not found bit plugin set as enabled")
|
|
|
|
elseif(NOT LIBV4L2_FOUND)
|
2014-07-23 13:18:01 -07:00
|
|
|
message(STATUS "libv4l2 not found, disabling v4l2 plugin")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2014-10-14 14:32:52 -07:00
|
|
|
if(NOT UDEV_FOUND OR DISABLE_UDEV)
|
|
|
|
message(STATUS "udev disabled for v4l2 plugin")
|
|
|
|
else()
|
|
|
|
set(linux-v4l2-udev_SOURCES
|
|
|
|
v4l2-udev.c
|
|
|
|
)
|
|
|
|
add_definitions(-DHAVE_UDEV)
|
|
|
|
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
|
|
|
|
v4l2-input.c
|
2014-08-10 08:33:03 -07:00
|
|
|
v4l2-helpers.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
|
|
|
)
|
|
|
|
|
2014-08-19 05:24:59 -07:00
|
|
|
install_obs_plugin_with_data(linux-v4l2 data)
|