CMake: Fix FindGLESv2

Avoids a linking error when the library is not found as
find_library sets GLESv2_LIBRARY to GLESv2-NOTFOUND

Change-Id: I7ddc15483276e0be0c78b67b760c4d9188758270
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Julien Schueller 2020-09-11 19:28:42 +02:00
parent a54988c822
commit cf33d64528

View File

@ -9,7 +9,9 @@ else()
find_path(GLESv2_INCLUDE_DIR NAMES "GLES2/gl2.h" "OpenGLES/ES2/gl.h" DOC "The OpenGLES 2 include path")
find_package(EGL)
set(_libraries "${CMAKE_REQUIRED_LIBRARIES}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${GLESv2_LIBRARY}")
if(GLESv2_LIBRARY)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${GLESv2_LIBRARY}")
endif ()
if(EGL_LIBRARY)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}")
endif()