[Release] Webkit2-efl-123997_0.11.46
[framework/web/webkit-efl.git] / Source / cmake / FindGLES.cmake
1 # - Try to find GLES20
2 # Once done, this will define
3 #
4 #  GLES20_FOUND - system has GLES20
5 #  GLES20_INCLUDE_DIRS - the GLES20 include directories
6 #  GLES20_LIBRARIES - link these to use GLES20
7
8 include(LibFindMacros)
9
10 # Use pkg-config to get hints about paths
11 libfind_pkg_check_modules(GLES20_PKGCONF gles20)
12
13 # Include dir
14 find_path(GLES20_INCLUDE_DIR
15   NAMES GLES2/gl2.h
16   PATHS ${GLES20_PKGCONF_INCLUDE_DIRS}
17 )
18
19 # Finally the library itself
20 find_library(GLES_LIBRARY
21   NAMES GLESv2
22   PATHS ${GLES20_PKGCONF_LIBRARY_DIRS}
23 )
24
25 find_library(EGL_LIBRARY
26   NAMES EGL
27   PATHS ${GLES20_PKGCONF_LIBRARY_DIRS}
28 )
29
30 # Include dir
31 find_path(EGL_INCLUDE_DIR
32   NAMES EGL/eglext.h
33   PATHS ${GLES20_PKGCONF_INCLUDE_DIRS}
34 )
35
36 SET(GLES20_LIBRARY 
37     ${GLES_LIBRARY}
38     ${EGL_LIBRARY}
39 )
40
41 # Set the include dir variables and the libraries and let libfind_process do the rest.
42 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
43 set(GLES20_PROCESS_INCLUDES GLES20_INCLUDE_DIR GLES20_INCLUDE_DIRS)
44 set(GLES20_PROCESS_LIBS GLES20_LIBRARY GLES20_LIBRARIES)
45 libfind_process(GLES20)
46