Merge pull request #8448 from aguinet/fix/cmake_ogl

cmake: set OpenGL_GL_PREFERENCE as a cached variable that can be modi…
This commit is contained in:
Léo Lam 2019-11-08 21:42:57 +01:00 committed by GitHub
commit 0ff99b374e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -423,7 +423,8 @@ endif()
include(CheckLib)
include(CheckCXXSourceRuns)
set(OpenGL_GL_PREFERENCE GLVND)
set(OpenGL_GL_PREFERENCE GLVND CACHE STRING "Linux-only: if GLVND, use the vendor-neutral GL libraries (default). If LEGACY, use the legacy ones (might be necessary to have optirun/primusrun work)")
set_property(CACHE OpenGL_GL_PREFERENCE PROPERTY STRINGS GLVND LEGACY)
find_package(OpenGL)
if (OPENGL_GL)
include_directories(${OPENGL_INCLUDE_DIR})