From fb4b2ed0d34f4b1240b5f69fb3a3e77efc191aa1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 26 Feb 2021 15:31:28 -0500 Subject: 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. --- Modules/FindOpenGL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v0.12