FindEGL.cmake 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. find_package(PkgConfig)
  33. pkg_check_modules(PC_EGL egl)
  34. if (PC_EGL_FOUND)
  35. set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER})
  36. endif ()
  37. find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h
  38. HINTS ${PC_EGL_INCLUDEDIR} ${PC_EGL_INCLUDE_DIRS}
  39. )
  40. set(EGL_NAMES ${EGL_NAMES} egl EGL)
  41. find_library(EGL_LIBRARIES NAMES ${EGL_NAMES}
  42. HINTS ${PC_EGL_LIBDIR} ${PC_EGL_LIBRARY_DIRS}
  43. )
  44. include(FindPackageHandleStandardArgs)
  45. FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIRS EGL_LIBRARIES)
  46. mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES)