Skip to content

Commit 24926d1

Browse files
committed
Merge commit '5cd37938c52d3b35aa8bfba84d100baa718d714c' into incoming
2 parents 805ea30 + 5cd3793 commit 24926d1

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

cmake/Modules/FindOpenGL.cmake

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Locate OpenGL
2+
# This module defines:
3+
# OPENGL_FOUND - system has OpenGL
4+
# OPENGL_XMESA_FOUND - system has XMESA
5+
# OPENGL_GLU_FOUND - system has GLU
6+
# OPENGL_INCLUDE_DIR - the GL include directory
7+
# OPENGL_LIBRARIES - Link these to use OpenGL and GLU
8+
# OPENGL_gl_LIBRARY - Path to OpenGL Library
9+
# OPENGL_glu_LIBRARY - Path to GLU Library
10+
11+
# The implementation is based on the standard FindOpenGL.cmake provided with CMake,
12+
# but customized for targeting Emscripten only.
13+
14+
# These libraries are provided with Emscripten
15+
SET(OPENGL_FOUND TRUE)
16+
SET(OPENGL_GLU_FOUND TRUE)
17+
18+
# Doesn't look like this one is part of Emscripten
19+
SET(OPENGL_XMESA_FOUND FALSE)
20+
21+
# This is the path where <GL/gl.h> is found
22+
SET(OPENGL_INCLUDE_DIR "${EMSCRIPTEN_ROOT_PATH}/system/include")
23+
24+
# No library to link against for OpenGL, since Emscripten picks it up automatically from library_gl.js,
25+
# but need to report something, or CMake thinks we failed in the search.
26+
SET(OPENGL_LIBRARIES "nul")
27+
SET(OPENGL_gl_LIBRARY "nul")
28+
SET(OPENGL_glu_LIBRARY "nul")
29+
30+
mark_as_advanced(
31+
OPENGL_INCLUDE_DIR
32+
OPENGL_glu_LIBRARY
33+
OPENGL_gl_LIBRARY
34+
)

0 commit comments

Comments
 (0)