summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenGL.cmake
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2021-02-26 20:31:28 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2021-02-26 20:36:55 (GMT)
commitfb4b2ed0d34f4b1240b5f69fb3a3e77efc191aa1 (patch)
tree16040a0a5a7a5322a5b247f4a879bacb079ce006 /Modules/FindOpenGL.cmake
parente53a73c6c96439435df172383ec97f0b659c6b5d (diff)
downloadCMake-fb4b2ed0d34f4b1240b5f69fb3a3e77efc191aa1.zip
CMake-fb4b2ed0d34f4b1240b5f69fb3a3e77efc191aa1.tar.gz
CMake-fb4b2ed0d34f4b1240b5f69fb3a3e77efc191aa1.tar.bz2
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.
Diffstat (limited to 'Modules/FindOpenGL.cmake')
-rw-r--r--Modules/FindOpenGL.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 4766102..d6d1c00 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -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