CMake: Fix build breakage trying to set OpenGL version

Fixes #660.
This commit is contained in:
Ahmad Fatoum 2018-10-11 13:39:23 +02:00
parent 9ac5a8b1a0
commit 9b25da5f98
No known key found for this signature in database
GPG Key ID: C3EAC3DE9321D59B

View File

@ -125,6 +125,7 @@ elseif(${PLATFORM} MATCHES "Raspberry Pi")
endif()
if (${OPENGL_VERSION})
MESSAGE(STATUS "Detected OpenGL version: ${OPENGL_VERSION}")
set(${SUGGESTED_GRAPHICS} "${GRAPHICS}")
if (${OPENGL_VERSION} MATCHES "3.3")
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
@ -135,7 +136,7 @@ if (${OPENGL_VERSION})
elseif (${OPENGL_VERSION} MATCHES "ES 2.0")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
endif()
if (${SUGGESTED_GRAPHICS} AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}")
if ("${SUGGESTED_GRAPHICS}" AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}")
message(WARNING "You are overriding the suggested GRAPHICS=${SUGGESTED_GRAPHICS} with ${GRAPHICS}! This may fail")
endif()
endif()