Nix upstreaming - Adding build files and supporting scripts
[WebKit-https.git] / Source / cmake / FindOpenGLES2.cmake
1 # Try to find OpenGLES2. Once done this will define:
2 #     OPENGLES2_FOUND
3 #     OPENGLES2_INCLUDE_DIRS
4 #     OPENGLES2_LIBRARIES
5 #     OPENGLES2_DEFINITIONS
6
7 find_package(PkgConfig)
8
9 pkg_check_modules(PC_OPENGLES2 glesv2)
10
11 if (PC_OPENGLES2_FOUND)
12     set(OPENGLES2_INCLUDE_DIRS ${PC_OPENGLES2_INCLUDE_DIRS})
13     set(OPENGLES2_DEFINITIONS ${PC_OPENGLES2_CFLAGS_OTHER})
14 else ()
15     find_path(OPENGLES2_INCLUDE_DIRS NAMES GLES2/gl2.h)
16 endif ()
17
18 find_library(OPENGLES2_LIBRARIES GLESv2
19     HINTS ${PC_OPENGLES2_LIBRARY_DIRS} ${PC_OPENGLES2_LIBDIR}
20 )
21
22 include(FindPackageHandleStandardArgs)
23 find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG OPENGLES2_LIBRARIES OPENGLES2_INCLUDE_DIRS)
24
25 mark_as_advanced(OPENGLES2_INCLUDE_DIRS OPENGLES2_LIBRARY)