Browse Source

CMake: FindOpenGL looks for GLVND since CMake 3.10.

Not 3.11. Interestingly only the comments were wrong, not the actual
checks in the code.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
87dac6b33d
  1. 10
      modules/FindMagnum.cmake
  2. 2
      src/Magnum/Platform/CMakeLists.txt

10
modules/FindMagnum.cmake

@ -726,7 +726,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
endif()
# With GLVND (since CMake 3.11) we need to explicitly link to
# With GLVND (since CMake 3.10) we need to explicitly link to
# GLX/EGL because libOpenGL doesn't provide it. For EGL we have
# our own EGL find module, which makes things simpler. The
# upstream FindOpenGL is anything but simple. Also can't use
@ -773,7 +773,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
INTERFACE_LINK_LIBRARIES "--js-library ${MAGNUM_PLATFORM_JS}")
endif()
# With GLVND (since CMake 3.11) we need to explicitly link to
# With GLVND (since CMake 3.10) we need to explicitly link to
# GLX/EGL because libOpenGL doesn't provide it. For EGL we have
# our own EGL find module, which makes things simpler. The
# upstream FindOpenGL is anything but simple. Also can't use
@ -803,7 +803,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${X11_LIBRARIES})
# With GLVND (since CMake 3.11) we need to explicitly link to
# With GLVND (since CMake 3.10) we need to explicitly link to
# GLX because libOpenGL doesn't provide it. Also can't use
# OpenGL_OpenGL_FOUND, because that one is set also if GLVND is
# *not* found. WTF. Also can't just check for
@ -851,7 +851,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# GLX context dependencies
if(_component STREQUAL GlxContext)
# With GLVND (since CMake 3.11) we need to explicitly link to
# With GLVND (since CMake 3.10) we need to explicitly link to
# GLX because libOpenGL doesn't provide it. Also can't use
# OpenGL_OpenGL_FOUND, because that one is set also if GLVND is
# *not* found. If GLVND is not used, link to X11 instead. Also
@ -890,7 +890,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# GL library
elseif(_component STREQUAL GL)
if(NOT MAGNUM_TARGET_GLES OR (MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_EGL AND NOT CORRADE_TARGET_IOS))
# If the GLVND library (CMake 3.11+) was found, link to the
# If the GLVND library (CMake 3.10+) was found, link to the
# imported target. Otherwise (and also on all systems except
# Linux) link to the classic libGL. Can't use
# OpenGL_OpenGL_FOUND, because that one is set also if GLVND is

2
src/Magnum/Platform/CMakeLists.txt

@ -440,7 +440,7 @@ if(MAGNUM_WITH_GLXAPPLICATION)
target_link_libraries(MagnumGlxApplication PUBLIC
MagnumGL
${X11_LIBRARIES})
# If the GLVND library (CMake 3.11+) was found and linked to, we need to
# If the GLVND library (CMake 3.10+) was found and linked to, we need to
# link to GLX explicitly. Otherwise (and also on all systems except Linux)
# the transitive dependency to classic GL lib from MagnumGL is enough.
# Can't use OpenGL_OpenGL_FOUND, because that one is set also if GLVND is

Loading…
Cancel
Save