From 9fc8b732737f139d3e466510d75668ab45578960 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 8 Mar 2016 21:02:53 +0100 Subject: sync with upstream --- project/cmake/modules/FindEGL.cmake | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 project/cmake/modules/FindEGL.cmake (limited to 'project/cmake/modules/FindEGL.cmake') diff --git a/project/cmake/modules/FindEGL.cmake b/project/cmake/modules/FindEGL.cmake new file mode 100644 index 0000000..79bb176 --- /dev/null +++ b/project/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 -DHAVE_LIBEGL=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 HAVE_LIBEGL=1) + endif() +endif() + +mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY) -- cgit v1.2.3