| 1 |
# from https://raw.githubusercontent.com/WebKit/webkit/master/Source/cmake/FindEGL.cmake |
| 2 |
# - Try to Find EGL |
| 3 |
# Once done, this will define |
| 4 |
# |
| 5 |
# EGL_FOUND - system has EGL installed. |
| 6 |
# EGL_INCLUDE_DIRS - directories which contain the EGL headers. |
| 7 |
# EGL_LIBRARIES - libraries required to link against EGL. |
| 8 |
# EGL_DEFINITIONS - Compiler switches required for using EGL. |
| 9 |
# |
| 10 |
# Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 11 |
# |
| 12 |
# Redistribution and use in source and binary forms, with or without |
| 13 |
# modification, are permitted provided that the following conditions |
| 14 |
# are met: |
| 15 |
# 1. Redistributions of source code must retain the above copyright |
| 16 |
# notice, this list of conditions and the following disclaimer. |
| 17 |
# 2. Redistributions in binary form must reproduce the above copyright |
| 18 |
# notice, this list of conditions and the following disclaimer in the |
| 19 |
# documentation and/or other materials provided with the distribution. |
| 20 |
# |
| 21 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS |
| 22 |
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 23 |
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 24 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS |
| 25 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 26 |
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 27 |
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 28 |
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 29 |
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 30 |
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 31 |
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 |
|
| 33 |
|
| 34 |
find_package(PkgConfig) |
| 35 |
|
| 36 |
pkg_check_modules(PC_EGL egl) |
| 37 |
|
| 38 |
if (PC_EGL_FOUND) |
| 39 |
set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER}) |
| 40 |
endif () |
| 41 |
|
| 42 |
find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h |
| 43 |
HINTS ${PC_EGL_INCLUDEDIR} ${PC_EGL_INCLUDE_DIRS} |
| 44 |
) |
| 45 |
|
| 46 |
set(EGL_NAMES ${EGL_NAMES} egl EGL) |
| 47 |
find_library(EGL_LIBRARIES NAMES ${EGL_NAMES} |
| 48 |
HINTS ${PC_EGL_LIBDIR} ${PC_EGL_LIBRARY_DIRS} |
| 49 |
) |
| 50 |
|
| 51 |
include(FindPackageHandleStandardArgs) |
| 52 |
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIRS EGL_LIBRARIES) |
| 53 |
|
| 54 |
mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES) |