Skip to content

Commit

Permalink
cmake: set OpenGL_GL_PREFERENCE as a cached variable that can be modi…
Browse files Browse the repository at this point in the history
…fied via the command line

This allows the user to set this to LEGACY. This can be useful for
people under Linux using optirun/primusrun with "old" nvidia drivers
that don't support GLVND properly.
  • Loading branch information
aguinet committed Nov 3, 2019
1 parent a7d4be7 commit 7f74707
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Expand Up @@ -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})
Expand Down

0 comments on commit 7f74707

Please sign in to comment.