FindOpenGLES2.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #-------------------------------------------------------------------
  2. # The contents of this file are placed in the public domain. Feel
  3. # free to make use of it in any way you like.
  4. #-------------------------------------------------------------------
  5. # Try to find OpenGL ES 2 and EGL
  6. if(WIN32)
  7. find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h)
  8. find_library(OPENGLES2_LIBRARY libGLESv2)
  9. elseif(APPLE)
  10. find_library(OPENGLES2_LIBRARY OpenGLES REQUIRED) # framework
  11. else()
  12. # Unix
  13. find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
  14. PATHS /usr/X11R6/include /usr/include
  15. )
  16. find_library(OPENGLES2_LIBRARY
  17. NAMES GLESv2
  18. PATHS /usr/X11R6/lib /usr/lib
  19. )
  20. include(FindPackageHandleStandardArgs)
  21. find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG OPENGLES2_LIBRARY OPENGLES2_INCLUDE_DIR)
  22. find_path(EGL_INCLUDE_DIR EGL/egl.h
  23. PATHS /usr/X11R6/include /usr/include
  24. )
  25. find_library(EGL_LIBRARY
  26. NAMES EGL
  27. PATHS /usr/X11R6/lib /usr/lib
  28. )
  29. include(FindPackageHandleStandardArgs)
  30. find_package_handle_standard_args(EGL REQUIRED_VARS EGL_LIBRARY EGL_INCLUDE_DIR NAME_MISMATCHED)
  31. endif()
  32. set(OPENGLES2_LIBRARIES ${OPENGLES2_LIBRARY} ${EGL_LIBRARY})