CMake: split OpenGL check for macOS and Linux.

The GL check doesn't work nicely with macOS, while find_package doesn't work well with multiarch on Ubuntu.
This commit is contained in:
Aaron van Geffen 2016-08-01 12:38:13 +02:00 committed by Michał Janiszewski
parent 7e5102dd6f
commit 95ef81b4c8
1 changed files with 4 additions and 0 deletions

View File

@ -244,6 +244,10 @@ if (NOT DISABLE_OPENGL)
if (WIN32)
# Curl depends on openssl and ws2 in mingw builds, but is not wired up in pkg-config
set(GLLIBS opengl32)
elseif (APPLE)
# GL doesn't work nicely with macOS, while find_package doesn't work with multiarch on Ubuntu.
find_package(OpenGL REQUIRED)
set(GLLIBS ${OPENGL_LIBRARY})
else (WIN32)
PKG_CHECK_MODULES(GL REQUIRED gl)
set(GLLIBS ${GL_LIBRARIES})