-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopengl.cmake
50 lines (41 loc) · 1.24 KB
/
opengl.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
# Searches for OpenGL package
# Sets variable OPENGL_LIBRARIES to the list of GL and GLU libraries
#
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL)
if(OPENGL_FOUND)
message(STATUS "OPENGL_INCLUDE_DIR : ${OPENGL_INCLUDE_DIR}")
include_directories(${OPENGL_INCLUDE_DIR})
else()
if(WIN32)
list(APPEND OPENGL_LIBRARIES opengl32)
else()
list(APPEND OPENGL_LIBRARIES GL)
endif()
endif()
if(OPENGL_GLU_FOUND)
message(STATUS "GLU_INCLUDE_DIR: ${GLU_INCLUDE_DIR}")
include_directories(${GLU_INCLUDE_DIR})
else()
if(WIN32)
list(APPEND OPENGL_LIBRARIES glu32)
else()
list(APPEND OPENGL_LIBRARIES GLU)
endif()
endif()
if(WIN32)
# freeglut uses some timer functions defined in winmm
list(APPEND OPENGL_LIBRARIES winmm)
# Vorpaline's drag and drop support in freeglut requires shell32
list(APPEND OPENGL_LIBRARIES shell32)
elseif(APPLE)
# Nothing special to use OpenGL and Vorpaline on APPLE
else()
find_package(X11)
list(APPEND OPENGL_LIBRARIES X11)
# GLAD needs the dynamic linker to query symbols in OpenGL lib
list(APPEND OPENGL_LIBRARIES dl)
# GLFW needs these ones
list(APPEND OPENGL_LIBRARIES Xxf86vm Xrandr Xcursor Xinerama Xi)
endif()