File: FindOpenGL.cmake

package info (click to toggle)
performous 1.1%2Bgit20181118-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,736 kB
  • sloc: cpp: 30,008; ansic: 2,751; sh: 801; xml: 464; python: 374; makefile: 36
file content (44 lines) | stat: -rw-r--r-- 1,090 bytes parent folder | download | duplicates (5)
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
# - Try to find OpenGL
# Once done, this will define
#
#  OpenGL_FOUND - system has OpenGL (GL and GLU)
#  OpenGL_INCLUDE_DIRS - the OpenGL include directories
#  OpenGL_LIBRARIES - link these to use OpenGL
#  OpenGL_GL_LIBRARY - only GL
#  OpenGL_GLU_LIBRARY - only GLU
#
# See documentation on how to write CMake scripts at
# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries

include(LibFindMacros)

libfind_pkg_check_modules(OpenGL_PKGCONF gl)

find_path(OpenGL_INCLUDE_DIR
  NAMES GL/gl.h
  HINTS ${OpenGL_PKGCONF_INCLUDE_DIRS}
)

if(MSVC) #In MSVC, no need to link, just this hack to get CMake happy
  find_file(OpenGL_GL_LIBRARY
    opengl32.dll
  )

  find_file(OpenGL_GLU_LIBRARY
    glu32.dll
  )
else()
  find_library(OpenGL_GL_LIBRARY
    NAMES GL libopengl32.a opengl32
    HINTS ${OpenGL_PKGCONF_LIBRARY_DIRS}
  )

  find_library(OpenGL_GLU_LIBRARY
    NAMES GLU libglu32.a glu32
    HINTS ${OpenGL_PKGCONF_LIBRARY_DIRS}
  )
endif(MSVC)
set(OpenGL_PROCESS_INCLUDES OpenGL_INCLUDE_DIR)
set(OpenGL_PROCESS_LIBS OpenGL_GL_LIBRARY OpenGL_GLU_LIBRARY)
libfind_process(OpenGL)