build: Adjust looking for OpenGL and EGL

This commit is contained in:
Ryan Pavlik 2019-12-03 14:30:32 -06:00
parent 6df97aad00
commit 639b524ec9

View file

@ -23,7 +23,7 @@ include(SPIR-V)
find_package(Eigen3 REQUIRED) find_package(Eigen3 REQUIRED)
find_package(Vulkan REQUIRED) find_package(Vulkan REQUIRED)
find_package(OpenGL REQUIRED COMPONENTS GLX) find_package(EGL)
find_package(HIDAPI) find_package(HIDAPI)
find_package(OpenHMD) find_package(OpenHMD)
find_package(OpenCV COMPONENTS core calib3d highgui imgproc imgcodecs features2d video) find_package(OpenCV COMPONENTS core calib3d highgui imgproc imgcodecs features2d video)
@ -53,12 +53,17 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
pkg_search_module(WAYLAND wayland-client) pkg_search_module(WAYLAND wayland-client)
pkg_search_module(WAYLAND_SCANNER wayland-scanner) pkg_search_module(WAYLAND_SCANNER wayland-scanner)
pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols) pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols)
find_package(OpenGL COMPONENTS GLX)
else()
find_package(OpenGL)
endif() endif()
cmake_dependent_option(BUILD_WITH_WAYLAND "Enable Wayland support" ON "WAYLAND_FOUND AND WAYLAND_SCANNER_FOUND AND WAYLAND_PROTOCOLS_FOUND" OFF) cmake_dependent_option(BUILD_WITH_WAYLAND "Enable Wayland support" ON "WAYLAND_FOUND AND WAYLAND_SCANNER_FOUND AND WAYLAND_PROTOCOLS_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_XLIB "Enable xlib support" ON "X11_FOUND" OFF) cmake_dependent_option(BUILD_WITH_XLIB "Enable xlib support" ON "X11_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_XCB "Enable xcb support" ON "XCB_FOUND" OFF) cmake_dependent_option(BUILD_WITH_XCB "Enable xcb support" ON "XCB_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_OPENGL "Enable OpenGL Graphics API support" ON "OPENGL_FOUND" OFF) cmake_dependent_option(BUILD_WITH_OPENGL "Enable OpenGL Graphics API support" ON "OPENGL_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_EGL "Enable OpenGL on EGL Graphics API support" ON "BUILD_WITH_OPENGL AND EGL_FOUND" OFF)
set(BUILD_WITH_LIBUSB TRUE) set(BUILD_WITH_LIBUSB TRUE)
cmake_dependent_option(BUILD_WITH_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF) cmake_dependent_option(BUILD_WITH_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF)