1 #-------------------------------------------------------------------
2 # This file is stolen from part of the CMake build system for OGRE (Object-oriented Graphics Rendering Engine) http://www.ogre3d.org/
4 # The contents of this file are placed in the public domain. Feel
5 # free to make use of it in any way you like.
6 #-------------------------------------------------------------------
8 # - Try to find OpenGLES and EGL
9 # Once done this will define
11 # OPENGLES2_FOUND - system has OpenGLES
12 # OPENGLES2_INCLUDE_DIR - the GL include directory
13 # OPENGLES2_LIBRARIES - Link these to use OpenGLES
15 # EGL_FOUND - system has EGL
16 # EGL_INCLUDE_DIR - the EGL include directory
17 # EGL_LIBRARIES - Link these to use EGL
19 # Win32, Apple, and Android are not tested!
20 # Linux tested and works
24 find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h)
25 find_library(OPENGLES2_LIBRARY libGLESv2)
28 set(OPENGLES2_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for Win32")
31 # set(OPENGLES_LIBRARY ${SOURCE_DIR}/Dependencies/lib/release/libGLESv2.lib CACHE STRING "OpenGL ES 2.x library for win32"
35 create_search_paths(/Developer/Platforms)
36 findpkg_framework(OpenGLES2)
37 set(OPENGLES2_LIBRARY "-framework OpenGLES")
39 find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
40 PATHS /usr/openwin/share/include
41 /opt/graphics/OpenGL/include
46 find_library(OPENGLES2_LIBRARY
48 PATHS /opt/graphics/OpenGL/lib
50 /usr/shlib /usr/X11R6/lib
55 find_path(EGL_INCLUDE_DIR EGL/egl.h
56 PATHS /usr/openwin/share/include
57 /opt/graphics/OpenGL/include
62 find_library(EGL_LIBRARY
64 PATHS /opt/graphics/OpenGL/lib
71 # On Unix OpenGL usually requires X11.
72 # It doesn't require X11 on OSX.
79 set(OPENGLES2_LIBRARIES ${X11_LIBRARIES})
85 set(OPENGLES2_LIBRARIES ${OPENGLES2_LIBRARIES} ${OPENGLES2_LIBRARY})
90 set(OPENGLES2_FOUND TRUE)
93 if(OPENGLES2_LIBRARY AND EGL_LIBRARY)
94 set(OPENGLES2_LIBRARIES ${OPENGLES2_LIBRARY} ${OPENGLES2_LIBRARIES})
95 set(EGL_LIBRARIES ${EGL_LIBRARY} ${EGL_LIBRARIES})
96 set(OPENGLES2_FOUND TRUE)
101 OPENGLES2_INCLUDE_DIR
108 message(STATUS "Found system OpenGL ES 2 library: ${OPENGLES2_LIBRARIES}")
110 set(OPENGLES2_LIBRARIES "")