2021-10-05 02:18:50 +02:00
|
|
|
project(linux-pipewire)
|
|
|
|
|
|
|
|
option(ENABLE_PIPEWIRE "Enable PipeWire support" ON)
|
|
|
|
if(NOT ENABLE_PIPEWIRE)
|
2022-03-25 18:51:41 +01:00
|
|
|
obs_status(DISABLED "linux-pipewire")
|
2021-10-05 02:18:50 +02:00
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2022-06-15 18:28:28 +02:00
|
|
|
find_package(PipeWire 0.3.32 REQUIRED)
|
2021-08-28 17:50:06 -03:00
|
|
|
find_package(Gio QUIET)
|
|
|
|
find_package(Libdrm QUIET) # we require libdrm/drm_fourcc.h to build
|
2021-10-05 02:18:50 +02:00
|
|
|
|
|
|
|
if(NOT TARGET PipeWire::PipeWire)
|
2022-03-25 18:51:41 +01:00
|
|
|
obs_status(
|
2021-10-05 02:18:50 +02:00
|
|
|
FATAL_ERROR
|
2022-03-25 18:51:41 +01:00
|
|
|
"PipeWire library not found! Please install PipeWire or set ENABLE_PIPEWIRE=OFF."
|
2021-10-05 02:18:50 +02:00
|
|
|
)
|
2021-08-28 17:50:06 -03:00
|
|
|
elseif(NOT TARGET GIO::GIO)
|
2022-03-25 18:51:41 +01:00
|
|
|
obs_status(
|
2021-08-28 17:50:06 -03:00
|
|
|
FATAL_ERROR
|
2022-03-25 18:51:41 +01:00
|
|
|
"Gio library not found! Please install GLib2 (or Gio) or set ENABLE_PIPEWIRE=OFF."
|
2021-08-28 17:50:06 -03:00
|
|
|
)
|
|
|
|
elseif(NOT TARGET Libdrm::Libdrm)
|
2022-03-25 18:51:41 +01:00
|
|
|
obs_status(
|
2021-08-28 17:50:06 -03:00
|
|
|
FATAL_ERROR
|
2022-03-25 18:51:41 +01:00
|
|
|
"libdrm headers not found! Please install libdrm or set ENABLE_PIPEWIRE=OFF."
|
2021-08-28 17:50:06 -03:00
|
|
|
)
|
2021-10-05 02:18:50 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(linux-pipewire MODULE)
|
|
|
|
add_library(OBS::pipewire ALIAS linux-pipewire)
|
|
|
|
|
2021-08-28 17:50:06 -03:00
|
|
|
target_sources(
|
|
|
|
linux-pipewire
|
|
|
|
PRIVATE linux-pipewire.c
|
|
|
|
pipewire.c
|
|
|
|
pipewire.h
|
|
|
|
portal.c
|
2022-06-22 11:49:02 -03:00
|
|
|
portal.h
|
|
|
|
screencast-portal.c
|
|
|
|
screencast-portal.h)
|
2021-08-28 17:50:06 -03:00
|
|
|
|
|
|
|
target_link_libraries(
|
|
|
|
linux-pipewire PRIVATE OBS::libobs OBS::obsglad PipeWire::PipeWire GIO::GIO
|
|
|
|
Libdrm::Libdrm)
|
2021-10-05 02:18:50 +02:00
|
|
|
|
|
|
|
set_target_properties(linux-pipewire PROPERTIES FOLDER "plugins")
|
|
|
|
|
|
|
|
setup_plugin_target(linux-pipewire)
|