build: Adjust usage of pkgconfig.

The existing thing would find pkg-config when cross-building for 32-bit,
but then immediately complain it wasn't found.
This commit is contained in:
Ryan Pavlik 2020-03-03 14:57:20 -06:00
parent 7db8a153a6
commit 6b2b9c4ff4

View file

@ -44,16 +44,17 @@ pkg_check_modules(FFMPEG libavcodec)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Compositor backend
find_package(X11)
find_package(PkgConfig REQUIRED)
pkg_check_modules(XCB xcb xcb-randr)
find_package(PkgConfig)
find_package(udev REQUIRED)
set(BUILD_DRIVER_V4L2 TRUE)
if(PKGCONFIG_FOUND)
pkg_check_modules(XCB xcb xcb-randr)
pkg_search_module(WAYLAND wayland-client)
pkg_search_module(WAYLAND_SCANNER wayland-scanner)
pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols)
pkg_search_module(WAYLAND wayland-client)
pkg_search_module(WAYLAND_SCANNER wayland-scanner)
pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols)
endif()
find_package(OpenGL COMPONENTS GLX)
else()
find_package(OpenGL)