mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
Add CMake as new build system
This commit is contained in:
38
cmake/FindOpenGLES2.cmake
Normal file
38
cmake/FindOpenGLES2.cmake
Normal file
@ -0,0 +1,38 @@
|
||||
#-------------------------------------------------------------------
|
||||
# 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 OpenGL ES 2 and EGL
|
||||
|
||||
if(WIN32)
|
||||
find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h)
|
||||
find_library(OPENGLES2_LIBRARY libGLESv2)
|
||||
elseif(APPLE)
|
||||
find_library(OPENGLES2_LIBRARY OpenGLES REQUIRED) # framework
|
||||
else()
|
||||
# Unix
|
||||
find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
|
||||
PATHS /usr/X11R6/include /usr/include
|
||||
)
|
||||
find_library(OPENGLES2_LIBRARY
|
||||
NAMES GLESv2
|
||||
PATHS /usr/X11R6/lib /usr/lib
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG OPENGLES2_LIBRARY OPENGLES2_INCLUDE_DIR)
|
||||
|
||||
find_path(EGL_INCLUDE_DIR EGL/egl.h
|
||||
PATHS /usr/X11R6/include /usr/include
|
||||
)
|
||||
find_library(EGL_LIBRARY
|
||||
NAMES EGL
|
||||
PATHS /usr/X11R6/lib /usr/lib
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(EGL REQUIRED_VARS EGL_LIBRARY EGL_INCLUDE_DIR NAME_MISMATCHED)
|
||||
endif()
|
||||
|
||||
set(OPENGLES2_LIBRARIES ${OPENGLES2_LIBRARY} ${EGL_LIBRARY})
|
Reference in New Issue
Block a user