File: FindGLFW.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 (38 lines) | stat: -rw-r--r-- 910 bytes parent folder | download | duplicates (4)
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
# - Try to find GLFW
# Once done, this will define
#
#  GLFW_FOUND - system has OpenGL (GL and GLU)
#  GLFW_INCLUDE_DIRS - the OpenGL include directories
#  GLFW_LIBRARIES - link these to use OpenGL
#
# See documentation on how to write CMake scripts at
# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries

include(LibFindMacros)

# Dependencies
libfind_package(GDK OpenGL)

libfind_pkg_check_modules(GLFW_PKGCONF libglfw)

find_path(GLFW_INCLUDE_DIR
  NAMES GL/glfw.h
  HINTS ${GLFW_PKGCONF_INCLUDE_DIRS}
)

find_library(GLFW_LIBRARY
  NAMES glfw
  HINTS ${GLFW_PKGCONF_LIBRARY_DIRS}
)

set(GLFW_PROCESS_INCLUDES GLFW_INCLUDE_DIR OpenGL_INCLUDE_DIRS)
set(GLFW_PROCESS_LIBS GLFW_LIBRARY OpenGL_LIBRARIES)

if(UNIX)
  find_library(X11_LIBRARY NAMES X11)
  find_library(Xrandr_LIBRARY NAMES Xrandr)
  set(GLFW_PROCESS_LIBS ${GLFW_PROCESS_LIBS} X11_LIBRARY Xrandr_LIBRARY)
endif(UNIX)

libfind_process(GLFW)