linux-capture: Add libdrm dependency check (#5326)
We require libdrm for its header so add the cmake module and header path to the build. We don't need to link libdrm though so we dont add it to libraries.
This commit is contained in:
parent
2be0d6b8ef
commit
7384f6f061
33
cmake/Modules/FindLibdrm.cmake
Normal file
33
cmake/Modules/FindLibdrm.cmake
Normal file
@ -0,0 +1,33 @@
|
||||
# Once done these will be defined:
|
||||
#
|
||||
# LIBDRM_FOUND
|
||||
# LIBDRM_INCLUDE_DIRS
|
||||
# LIBDRM_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_LIBDRM QUIET libdrm)
|
||||
endif()
|
||||
|
||||
find_path(LIBDRM_INCLUDE_DIR
|
||||
NAMES libdrm/drm_fourcc.h
|
||||
HINTS
|
||||
${_LIBDRM_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include)
|
||||
|
||||
find_library(LIBDRM_LIB
|
||||
NAMES drm libdrm
|
||||
HINTS
|
||||
${_LIBDRM_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libdrm DEFAULT_MSG LIBDRM_LIB LIBDRM_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBDRM_INCLUDE_DIR LIBDRM_LIB)
|
||||
|
||||
if(LIBDRM_FOUND)
|
||||
set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR})
|
||||
set(LIBDRM_LIBRARIES ${LIBDRM_LIB})
|
||||
endif()
|
@ -47,6 +47,7 @@ set(linux-capture_LIBRARIES
|
||||
option(ENABLE_PIPEWIRE "Enable PipeWire support" ON)
|
||||
if(ENABLE_PIPEWIRE)
|
||||
find_package(PipeWire QUIET)
|
||||
find_package(Libdrm) # we require libdrm/drm_fourcc.h to build
|
||||
find_package(Gio QUIET)
|
||||
|
||||
if(NOT PIPEWIRE_FOUND)
|
||||
@ -61,6 +62,7 @@ if(ENABLE_PIPEWIRE)
|
||||
${linux-capture_INCLUDES}
|
||||
${GIO_INCLUDE_DIRS}
|
||||
${PIPEWIRE_INCLUDE_DIRS}
|
||||
${DRM_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
|
Loading…
x
Reference in New Issue
Block a user