FindGLES2.cmake 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright (c) 2012, Guillermo A. Amaral B. (gamaral) <g@maral.me>.
  2. # All rights reserved.
  3. #
  4. # This file is part of Marshmallow Game Engine.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of source code must retain the above copyright notice,
  10. # this list of conditions and the following disclaimer.
  11. #
  12. # 2. Redistributions in binary form must reproduce the above copyright
  13. # notice, this list of conditions and the following disclaimer in the
  14. # documentation and/or other materials provided with the distribution.
  15. #
  16. # THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
  17. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19. # EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  22. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  23. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  24. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  25. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. #
  27. # The views and conclusions contained in the software and documentation are
  28. # those of the authors and should not be interpreted as representing official
  29. # policies, either expressed or implied, of the project as a whole.
  30. #
  31. ###############################################################################
  32. # Find GLES2
  33. ###############################################################################
  34. #
  35. # GLES2_FOUND
  36. # GLES2_INCLUDE_DIR
  37. # GLES2_LIBRARY
  38. #
  39. ###############################################################################
  40. find_path(GLES2_INCLUDE_DIR GLES2/gl2.h
  41. HINTS $ENV{GLES2DIR}
  42. PATH_SUFFIXES include
  43. PATHS ~/Library/Frameworks
  44. /Library/Frameworks
  45. /usr/local
  46. /usr
  47. /usr/X11R6
  48. /opt/local
  49. /opt/vc
  50. /opt
  51. )
  52. find_library(GLES2_LIBRARY
  53. GLESv2
  54. HINTS $ENV{GLES2DIR}
  55. PATH_SUFFIXES lib64 lib
  56. PATHS ~/Library/Frameworks
  57. /Library/Frameworks
  58. /usr/local
  59. /usr
  60. /usr/X11R6
  61. /opt/local
  62. /opt/vc
  63. /opt
  64. )
  65. include(FindPackageHandleStandardArgs)
  66. FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLES2 DEFAULT_MSG GLES2_LIBRARY)
  67. mark_as_advanced(GLES2_LIBRARY GLES2_INCLUDE_DIR)
  68. set(OPENGL_FOUND ${GLES2_FOUND})