From f44ecaa4f27e7538ddcad66d40e543bffa2d2d86 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 4 Jun 2017 16:57:49 +0200 Subject: sync with upstream --- cmake/modules/FindEGL.cmake | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cmake/modules/FindEGL.cmake (limited to 'cmake/modules/FindEGL.cmake') diff --git a/cmake/modules/FindEGL.cmake b/cmake/modules/FindEGL.cmake new file mode 100644 index 0000000..93fa530 --- /dev/null +++ b/cmake/modules/FindEGL.cmake @@ -0,0 +1,48 @@ +#.rst: +# FindEGL +# ------- +# Finds the EGL library +# +# This will will define the following variables:: +# +# EGL_FOUND - system has EGL +# EGL_INCLUDE_DIRS - the EGL include directory +# EGL_LIBRARIES - the EGL libraries +# EGL_DEFINITIONS - the EGL definitions +# +# and the following imported targets:: +# +# EGL::EGL - The EGL library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_EGL egl QUIET) +endif() + +find_path(EGL_INCLUDE_DIR EGL/egl.h + PATHS ${PC_EGL_INCLUDEDIR}) + +find_library(EGL_LIBRARY NAMES EGL egl + PATHS ${PC_EGL_LIBDIR}) + +set(EGL_VERSION ${PC_EGL_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EGL + REQUIRED_VARS EGL_LIBRARY EGL_INCLUDE_DIR + VERSION_VAR EGL_VERSION) + +if(EGL_FOUND) + set(EGL_LIBRARIES ${EGL_LIBRARY}) + set(EGL_INCLUDE_DIRS ${EGL_INCLUDE_DIR}) + set(EGL_DEFINITIONS -DHAS_EGL=1) + + if(NOT TARGET EGL::EGL) + add_library(EGL::EGL UNKNOWN IMPORTED) + set_target_properties(EGL::EGL PROPERTIES + IMPORTED_LOCATION "${EGL_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAS_EGL=1) + endif() +endif() + +mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY) -- cgit v1.2.3