|
| 1 | +#------------------------------------------------------------------- |
| 2 | +# This file is part of the CMake build system for OGRE |
| 3 | +# (Object-oriented Graphics Rendering Engine) |
| 4 | +# For the latest info, see http://www.ogre3d.org/ |
| 5 | +# |
| 6 | +# The contents of this file are placed in the public domain. Feel |
| 7 | +# free to make use of it in any way you like. |
| 8 | +#------------------------------------------------------------------- |
| 9 | + |
| 10 | +# - Try to find OpenGLES and EGL |
| 11 | +# If using ARM Mali emulation you can specify the parent directory that contains the bin and include directories by |
| 12 | +# setting the MALI_SDK_ROOT variable in the environment. |
| 13 | +# |
| 14 | +# For AMD emulation use the AMD_SDK_ROOT variable |
| 15 | +# |
| 16 | +# Once done this will define |
| 17 | +# |
| 18 | +# OPENGLES2_FOUND - system has OpenGLES |
| 19 | +# OPENGLES2_INCLUDE_DIR - the GL include directory |
| 20 | +# OPENGLES2_LIBRARIES - Link these to use OpenGLES |
| 21 | +# |
| 22 | +# EGL_FOUND - system has EGL |
| 23 | +# EGL_INCLUDE_DIR - the EGL include directory |
| 24 | +# EGL_LIBRARIES - Link these to use EGL |
| 25 | + |
| 26 | +#include(FindPkgMacros) |
| 27 | + |
| 28 | +IF (WIN32) |
| 29 | + IF (CYGWIN) |
| 30 | + |
| 31 | + FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h ) |
| 32 | + |
| 33 | + FIND_LIBRARY(OPENGLES2_gl_LIBRARY libGLESv2 ) |
| 34 | + |
| 35 | + ELSE (CYGWIN) |
| 36 | + |
| 37 | + IF(BORLAND) |
| 38 | + SET (OPENGLES2_gl_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for win32") |
| 39 | + ELSE(BORLAND) |
| 40 | + #getenv_path(AMD_SDK_ROOT) |
| 41 | + #getenv_path(MALI_SDK_ROOT) |
| 42 | + |
| 43 | + SET(POWERVR_SDK_PATH "C:/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds") |
| 44 | + FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h |
| 45 | + ${ENV_AMD_SDK_ROOT}/include |
| 46 | + ${ENV_MALI_SDK_ROOT}/include |
| 47 | + ${POWERVR_SDK_PATH}/Include |
| 48 | + "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include" |
| 49 | + ) |
| 50 | + |
| 51 | + FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h |
| 52 | + ${ENV_AMD_SDK_ROOT}/include |
| 53 | + ${ENV_MALI_SDK_ROOT}/include |
| 54 | + ${POWERVR_SDK_PATH}/Include |
| 55 | + "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include" |
| 56 | + ) |
| 57 | + |
| 58 | + FIND_LIBRARY(OPENGLES2_gl_LIBRARY |
| 59 | + NAMES libGLESv2 |
| 60 | + PATHS ${ENV_AMD_SDK_ROOT}/x86 |
| 61 | + ${ENV_MALI_SDK_ROOT}/bin |
| 62 | + ${POWERVR_SDK_PATH}/Windows/x86_32/Lib |
| 63 | + "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib" |
| 64 | + ) |
| 65 | + |
| 66 | + FIND_LIBRARY(EGL_egl_LIBRARY |
| 67 | + NAMES libEGL |
| 68 | + PATHS ${ENV_AMD_SDK_ROOT}/x86 |
| 69 | + ${ENV_MALI_SDK_ROOT}/bin |
| 70 | + ${POWERVR_SDK_PATH}/Windows/x86_32/Lib |
| 71 | + "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib" |
| 72 | + ) |
| 73 | + ENDIF(BORLAND) |
| 74 | + |
| 75 | + ENDIF (CYGWIN) |
| 76 | + |
| 77 | +ELSE (WIN32) |
| 78 | + |
| 79 | + IF (APPLE) |
| 80 | + |
| 81 | + #create_search_paths(/Developer/Platforms) |
| 82 | + #findpkg_framework(OpenGLES2) |
| 83 | + #set(OPENGLES2_gl_LIBRARY "-framework OpenGLES") |
| 84 | + |
| 85 | + ELSE(APPLE) |
| 86 | + #getenv_path(AMD_SDK_ROOT) |
| 87 | + #getenv_path(MALI_SDK_ROOT) |
| 88 | + |
| 89 | + FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h |
| 90 | + ${ENV_AMD_SDK_ROOT}/include |
| 91 | + ${ENV_MALI_SDK_ROOT}/include |
| 92 | + /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include |
| 93 | + /opt/vc/include |
| 94 | + /usr/openwin/share/include |
| 95 | + /opt/graphics/OpenGL/include /usr/X11R6/include |
| 96 | + /usr/include |
| 97 | + ) |
| 98 | + |
| 99 | + FIND_LIBRARY(OPENGLES2_gl_LIBRARY |
| 100 | + NAMES GLESv2 |
| 101 | + PATHS ${ENV_AMD_SDK_ROOT}/x86 |
| 102 | + ${ENV_MALI_SDK_ROOT}/bin |
| 103 | + /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib |
| 104 | + /opt/vc/lib |
| 105 | + /opt/graphics/OpenGL/lib |
| 106 | + /usr/openwin/lib |
| 107 | + /usr/shlib /usr/X11R6/lib |
| 108 | + /usr/lib |
| 109 | + ) |
| 110 | + |
| 111 | + FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h |
| 112 | + ${ENV_AMD_SDK_ROOT}/include |
| 113 | + ${ENV_MALI_SDK_ROOT}/include |
| 114 | + /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include |
| 115 | + /opt/vc/include |
| 116 | + /usr/openwin/share/include |
| 117 | + /opt/graphics/OpenGL/include /usr/X11R6/include |
| 118 | + /usr/include |
| 119 | + ) |
| 120 | + |
| 121 | + FIND_LIBRARY(EGL_egl_LIBRARY |
| 122 | + NAMES EGL |
| 123 | + PATHS ${ENV_AMD_SDK_ROOT}/x86 |
| 124 | + ${ENV_MALI_SDK_ROOT}/bin |
| 125 | + /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib |
| 126 | + /opt/vc/lib |
| 127 | + /opt/graphics/OpenGL/lib |
| 128 | + /usr/openwin/lib |
| 129 | + /usr/shlib /usr/X11R6/lib |
| 130 | + /usr/lib |
| 131 | + ) |
| 132 | + |
| 133 | + # On Unix OpenGL most certainly always requires X11. |
| 134 | + # Feel free to tighten up these conditions if you don't |
| 135 | + # think this is always true. |
| 136 | + # It's not true on OSX. |
| 137 | + |
| 138 | + #IF (OPENGLES2_gl_LIBRARY) |
| 139 | + # IF(NOT X11_FOUND) |
| 140 | + # INCLUDE(FindX11) |
| 141 | + # ENDIF(NOT X11_FOUND) |
| 142 | + # IF (X11_FOUND) |
| 143 | + # IF (NOT APPLE) |
| 144 | + # SET (OPENGLES2_LIBRARIES ${X11_LIBRARIES}) |
| 145 | + # ENDIF (NOT APPLE) |
| 146 | + # ENDIF (X11_FOUND) |
| 147 | + #ENDIF (OPENGLES2_gl_LIBRARY) |
| 148 | + |
| 149 | + ENDIF(APPLE) |
| 150 | +ENDIF (WIN32) |
| 151 | + |
| 152 | +SET( OPENGLES2_FOUND "YES" ) |
| 153 | +IF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY) |
| 154 | + |
| 155 | + SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES}) |
| 156 | + SET( EGL_LIBRARIES ${EGL_egl_LIBRARY} ${EGL_LIBRARIES}) |
| 157 | + SET( OPENGLES2_FOUND "YES" ) |
| 158 | + |
| 159 | +ENDIF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY) |
| 160 | + |
| 161 | +MARK_AS_ADVANCED( |
| 162 | + OPENGLES2_INCLUDE_DIR |
| 163 | + OPENGLES2_gl_LIBRARY |
| 164 | + EGL_INCLUDE_DIR |
| 165 | + EGL_egl_LIBRARY |
| 166 | +) |
| 167 | + |
| 168 | +INCLUDE(FindPackageHandleStandardArgs) |
| 169 | + |
| 170 | +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGLES2 REQUIRED_VARS OPENGLES2_LIBRARIES OPENGLES2_INCLUDE_DIR) |
0 commit comments