1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

FindOpenGL: handle GLX without GLVND

On Ubuntu, installing `libgl-dev` provides `libGL` and `libGLX`, but no
`libOpenGL`. Avoid defining GLVND targets without the `OpenGL::OpenGL`
target.
This commit is contained in:
Ben Boeckel
2021-02-26 15:31:28 -05:00
parent e53a73c6c9
commit fb4b2ed0d3

View File

@@ -465,7 +465,7 @@ if(OPENGL_FOUND)
# ::GLX is a GLVND library, and thus Linux-only: we don't bother checking
# for a framework version of this library.
if(OpenGL_GLX_FOUND AND NOT TARGET OpenGL::GLX)
if(OpenGL_GLX_FOUND AND NOT TARGET OpenGL::GLX AND TARGET OpenGL::OpenGL)
if(IS_ABSOLUTE "${OPENGL_glx_LIBRARY}")
add_library(OpenGL::GLX UNKNOWN IMPORTED)
set_target_properties(OpenGL::GLX PROPERTIES IMPORTED_LOCATION