~compiz-team/compiz/0.9.12

« back to all changes in this revision

Viewing changes to cmake/FindOpenGLES2.cmake

Import GLES2 branch: lp:~compiz-linaro-team/compiz-core/compiz-core.gles2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - Try to find OpenGLES
 
2
# Once done this will define
 
3
#  
 
4
#  OPENGLES2_FOUND        - system has OpenGLES
 
5
#  OPENGLES2_INCLUDE_DIR  - the GLES include directory
 
6
#  OPENGLES2_LIBRARY      - the GLES library
 
7
#  OPENGLES2_LIBRARIES    - Link this to use OpenGLES
 
8
#   
 
9
 
 
10
FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
 
11
  /usr/openwin/share/include
 
12
  /opt/graphics/OpenGL/include /usr/X11R6/include
 
13
  /usr/include
 
14
)
 
15
 
 
16
FIND_LIBRARY(OPENGLES2_LIBRARY
 
17
  NAMES GLESv2
 
18
  PATHS /opt/graphics/OpenGL/lib
 
19
        /usr/openwin/lib
 
20
        /usr/shlib /usr/X11R6/lib
 
21
        /usr/lib
 
22
)
 
23
 
 
24
FIND_LIBRARY(OPENGLES2_EGL_LIBRARY
 
25
    NAMES EGL
 
26
    PATHS /usr/shlib /usr/X11R6/lib
 
27
          /usr/lib
 
28
)
 
29
 
 
30
# On Unix OpenGL most certainly always requires X11.
 
31
# Feel free to tighten up these conditions if you don't 
 
32
# think this is always true.
 
33
# It's not true on OSX.
 
34
 
 
35
IF (OPENGLES2_LIBRARY)
 
36
  IF(NOT X11_FOUND)
 
37
    INCLUDE(FindX11)
 
38
  ENDIF(NOT X11_FOUND)
 
39
  IF (X11_FOUND)
 
40
    IF (NOT APPLE)
 
41
      SET (OPENGLES2_LIBRARIES ${X11_LIBRARIES})
 
42
    ENDIF (NOT APPLE)
 
43
  ENDIF (X11_FOUND)
 
44
ENDIF(OPENGLES2_LIBRARY)
 
45
 
 
46
SET( OPENGLES2_FOUND "NO" )
 
47
IF(OPENGLES2_LIBRARY AND OPENGLES2_EGL_LIBRARY)
 
48
    SET( OPENGLES2_LIBRARIES  ${OPENGLES2_LIBRARY} ${OPENGLES2_EGL_LIBRARY} ${OPENGLES2_LIBRARIES})
 
49
    SET( OPENGLES2_FOUND "YES" )
 
50
ENDIF(OPENGLES2_LIBRARY AND OPENGLES2_EGL_LIBRARY)
 
51