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, android NOT TESED
20 # linux tested and works
25 FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h )
27 FIND_LIBRARY(OPENGLES2_gl_LIBRARY libGLESv2 )
32 SET (OPENGLES2_gl_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for win32")
35 # SET (OPENGLES_gl_LIBRARY ${SOURCE_DIR}/Dependencies/lib/release/libGLESv2.lib CACHE STRING "OpenGL ES 2.x library for win32"
44 create_search_paths(/Developer/Platforms)
45 findpkg_framework(OpenGLES2)
46 set(OPENGLES2_gl_LIBRARY "-framework OpenGLES")
50 FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
51 /usr/openwin/share/include
52 /opt/graphics/OpenGL/include /usr/X11R6/include
56 FIND_LIBRARY(OPENGLES2_gl_LIBRARY
58 PATHS /opt/graphics/OpenGL/lib
60 /usr/shlib /usr/X11R6/lib
64 IF (NOT BUILD_ANDROID)
65 FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h
66 /usr/openwin/share/include
67 /opt/graphics/OpenGL/include /usr/X11R6/include
71 FIND_LIBRARY(EGL_egl_LIBRARY
73 PATHS /opt/graphics/OpenGL/lib
75 /usr/shlib /usr/X11R6/lib
79 # On Unix OpenGL most certainly always requires X11.
80 # Feel free to tighten up these conditions if you don't
81 # think this is always true.
82 # It's not true on OSX.
84 IF (OPENGLES2_gl_LIBRARY)
90 SET (OPENGLES2_LIBRARIES ${X11_LIBRARIES})
93 ENDIF (OPENGLES2_gl_LIBRARY)
99 #SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES})
102 IF(OPENGLES2_gl_LIBRARY)
103 SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES})
105 SET( OPENGLES2_FOUND "YES" )
106 ENDIF(OPENGLES2_gl_LIBRARY)
109 SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES})
111 IF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY)
112 SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES})
113 SET( EGL_LIBRARIES ${EGL_egl_LIBRARY} ${EGL_LIBRARIES})
114 SET( OPENGLES2_FOUND "YES" )
115 ENDIF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY)
120 OPENGLES2_INCLUDE_DIR
127 MESSAGE(STATUS "Found system opengles2 library ${OPENGLES2_LIBRARIES}")
129 SET(OPENGLES2_LIBRARIES "")