Commit dcc1cb66 authored by Manuel Grizonnet's avatar Manuel Grizonnet

BUG: OpenGL missing libraries dectection should test also GLVND library

CMake 3.11 and above prefer to choose GLVND libraries, OTB check of OpenGL libraries should check this library. This bug can appear also with previous cmake version if the OpenGL_GL_Preferences is changed.
parent 447e1151
......@@ -74,8 +74,13 @@ if(NOT OPENGL_INCLUDE_DIR)
endif()
endif()
if(NOT OPENGL_gl_LIBRARY)
message(FATAL_ERROR "Could not find OpenGL (missing: OPENGL_gl_LIBRARY")
# For CMake > 3.11 the default GLVND instead of legacy GL library
# Test both of them to
# FIXME: As stated in CMake documentation we should use the OpenGL::* import targets instead available
# It should be done when OTB will increase CMake minimum version to 3.X
# See: https://cmake.org/cmake/help/v3.11/module/FindOpenGL.html
if(NOT OPENGL_gl_LIBRARY AND NOT OPENGL_opengl_LIBRARY)
message(FATAL_ERROR "Could not find OpenGL (missing: OPENGL_gl_LIBRARY or OPENGL_opengl_LIBRARY")
endif()
if(NOT OPENGL_glu_LIBRARY)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment