Skip to content

Commit

Permalink
Merge remote-tracking branch 'retropie/master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
joolswills committed Nov 1, 2020
2 parents 982f6cc + fcccca9 commit 534883e
Show file tree
Hide file tree
Showing 16 changed files with 243 additions and 249 deletions.
131 changes: 39 additions & 92 deletions CMake/Packages/FindOpenGLES.cmake
Original file line number Diff line number Diff line change
@@ -1,101 +1,48 @@
#snapped from: https://bitbucket.org/sinbad/ogre/src/0bba4f7cdb95/CMake/Packages/FindOpenGLES.cmake?at=default
#-------------------------------------------------------------------
# This file is part of the CMake build system for OGRE
# (Object-oriented Graphics Rendering Engine)
# For the latest info, see http://www.ogre3d.org/
#
# The contents of this file are placed in the public domain. Feel
# free to make use of it in any way you like.
#-------------------------------------------------------------------

# - Try to find OpenGLES
# Once done this will define
#
# OPENGLES_FOUND - system has OpenGLES
# OPENGLES_INCLUDE_DIR - the GL include directory
# OPENGLES_INCLUDE_DIRS - the GL include directory
# OPENGLES_LIBRARIES - Link these to use OpenGLES

IF (WIN32)
IF (CYGWIN)

FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h )

FIND_LIBRARY(OPENGLES_gl_LIBRARY libgles_cm )

ELSE (CYGWIN)

IF(MSVC)
#The user hast to provide this atm. GLES can be emulated via Desktop OpenGL
if(NOT HINT_GLES_LIBNAME)
set(HINT_GLES_LIBNAME GLESv1_CM)
endif()

if (WIN32)
if(CYGWIN)
find_path(OPENGLES_INCLUDE_DIR GLES/gl.h )
find_library(OPENGLES_gl_LIBRARY libgles_cm )
else(CYGWIN)
if(MSVC)
#The user has to provide this atm. GLES can be emulated via Desktop OpenGL
#using the ANGLE project found at: http://code.google.com/p/angleproject/
SET (OPENGLES_gl_LIBRARY import32 CACHE STRING "OpenGL ES 1.x library for win32")
ENDIF(MSVC)

ENDIF (CYGWIN)

ELSE (WIN32)

IF (APPLE)

create_search_paths(/Developer/Platforms)
findpkg_framework(OpenGLES)
endif(MSVC)
endif(CYGWIN)
elseif(APPLE)
create_search_paths(/Developer/Platforms)
findpkg_framework(OpenGLES)
set(OPENGLES_gl_LIBRARY "-framework OpenGLES")

ELSE(APPLE)

IF (DEFINED BCMHOST)
FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h
/opt/vc/include
NO_DEFAULT_PATH
)

FIND_LIBRARY(OPENGLES_gl_LIBRARY
NAMES brcmGLESv2
PATHS /opt/vc/lib
)

ELSE (DEFINED BCMHOST)

FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h
/usr/openwin/share/include
/opt/graphics/OpenGL/include /usr/X11R6/include
/usr/include
)

FIND_LIBRARY(OPENGLES_gl_LIBRARY
NAMES GLES_CM GLESv1_CM
PATHS /opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib /usr/X11R6/lib
/usr/lib
)
ENDIF (DEFINED BCMHOST)

# On Unix OpenGL most certainly always requires X11.
# Feel free to tighten up these conditions if you don't
# think this is always true.

IF (OPENGLES_gl_LIBRARY)
IF(NOT X11_FOUND)
INCLUDE(FindX11)
ENDIF(NOT X11_FOUND)
IF (X11_FOUND)
SET (OPENGLES_LIBRARIES ${X11_LIBRARIES})
ENDIF (X11_FOUND)
ENDIF (OPENGLES_gl_LIBRARY)

ENDIF(APPLE)
ENDIF (WIN32)

SET( OPENGLES_FOUND "NO" )
IF(OPENGLES_gl_LIBRARY)

SET( OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY} ${OPENGLES_LIBRARIES})

SET( OPENGLES_FOUND "YES" )

ENDIF(OPENGLES_gl_LIBRARY)

MARK_AS_ADVANCED(
OPENGLES_INCLUDE_DIR
OPENGLES_gl_LIBRARY
)
else()
find_path(OPENGLES_INCLUDE_DIR GLES/gl.h
PATHS "${CMAKE_FIND_ROOT_PATH}/usr/include"
HINTS "${HINT_GLES_INCDIR}"
)

find_library(OPENGLES_gl_LIBRARY
NAMES ${HINT_GLES_LIBNAME}
HINTS "${HINT_GLES_LIBDIR}"
)
endif(WIN32)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGLES
REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR)


if(OPENGLES_FOUND)
set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY})
set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY)
endif()
35 changes: 35 additions & 0 deletions CMake/Packages/FindOpenGLES2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# FindOpenGLES
# ------------
# Finds the OpenGLES2 library
#
# This will define the following variables::
#
# OPENGLES2_FOUND - system has OpenGLES
# OPENGLES2_INCLUDE_DIRS - the OpenGLES include directory
# OPENGLES2_LIBRARIES - the OpenGLES libraries

if(NOT HINT_GLES_LIBNAME)
set(HINT_GLES_LIBNAME GLESv2)
endif()

find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
PATHS "${CMAKE_FIND_ROOT_PATH}/usr/include"
HINTS ${HINT_GLES_INCDIR}
)

find_library(OPENGLES2_gl_LIBRARY
NAMES ${HINT_GLES_LIBNAME}
HINTS ${HINT_GLES_LIBDIR}
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGLES2
REQUIRED_VARS OPENGLES2_gl_LIBRARY OPENGLES2_INCLUDE_DIR)


if(OPENGLES2_FOUND)
set(OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY})
set(OPENGLES2_INCLUDE_DIRS ${OPENGLES2_INCLUDE_DIR})
mark_as_advanced(OPENGLES2_INCLUDE_DIR OPENGLES2_gl_LIBRARY)
endif()

Loading

0 comments on commit 534883e

Please sign in to comment.