Fix breakage of non-GLES2 setups (#8774)

The commit 526a9e4b66 breaks
the non-GLES2 setups because the code that is intended to
handle that is behind "elseif()" which is interpreted as
"elseif(false)" and thus the code never gets executed. Fix
that by changing the offending line to else().

Additionally, to avoid breaking the server only build
(which shall not have a dependency on GL/GLU/GLES at all),
enclose the entire block code in if(BUILD_CLIENT).
master
Jozef Behran 2019-08-10 23:32:47 +02:00 committed by SmallJoker
parent 120155f312
commit 49f1006183
1 changed files with 10 additions and 8 deletions

View File

@ -104,15 +104,17 @@ endif()
option(ENABLE_GLES "Use OpenGL ES instead of OpenGL" FALSE) option(ENABLE_GLES "Use OpenGL ES instead of OpenGL" FALSE)
mark_as_advanced(ENABLE_GLES) mark_as_advanced(ENABLE_GLES)
if(ENABLE_GLES) if(BUILD_CLIENT)
find_package(OpenGLES2 REQUIRED) if(ENABLE_GLES)
elseif() find_package(OpenGLES2 REQUIRED)
if(NOT WIN32) # Unix probably else()
set(OPENGL_GL_PREFERENCE "LEGACY" CACHE STRING if(NOT WIN32) # Unix probably
"See CMake Policy CMP0072 for reference. GLVND is broken on some nvidia setups") set(OPENGL_GL_PREFERENCE "LEGACY" CACHE STRING
set(OpenGL_GL_PREFERENCE ${OPENGL_GL_PREFERENCE}) "See CMake Policy CMP0072 for reference. GLVND is broken on some nvidia setups")
set(OpenGL_GL_PREFERENCE ${OPENGL_GL_PREFERENCE})
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
endif()
endif() endif()
endif() endif()