summaryrefslogtreecommitdiffstats
path: root/project/cmake/modules/FindOpenGl.cmake
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2016-03-08 21:02:53 +0100
committermanuel <manuel@mausz.at>2016-03-08 21:02:53 +0100
commit9fc8b732737f139d3e466510d75668ab45578960 (patch)
tree76db9bf5cb8cc869be908a5ed3d6f4cca3e3608a /project/cmake/modules/FindOpenGl.cmake
parentb75e2659df11c23aa921d2eed83c23adc282ed27 (diff)
downloadkodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.gz
kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.bz2
kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.zip
sync with upstream
Diffstat (limited to 'project/cmake/modules/FindOpenGl.cmake')
-rw-r--r--project/cmake/modules/FindOpenGl.cmake43
1 files changed, 43 insertions, 0 deletions
diff --git a/project/cmake/modules/FindOpenGl.cmake b/project/cmake/modules/FindOpenGl.cmake
new file mode 100644
index 0000000..9d6ec01
--- /dev/null
+++ b/project/cmake/modules/FindOpenGl.cmake
@@ -0,0 +1,43 @@
1#.rst:
2# FindOpenGl
3# ----------
4# Finds the FindOpenGl library
5#
6# This will will define the following variables::
7#
8# OPENGL_FOUND - system has OpenGl
9# OPENGL_INCLUDE_DIRS - the OpenGl include directory
10# OPENGL_LIBRARIES - the OpenGl libraries
11# OPENGL_DEFINITIONS - the OpenGl definitions
12
13if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_OPENGL gl glu)
15endif()
16
17if(NOT CORE_SYSTEM_NAME STREQUAL darwin)
18 find_path(OPENGL_INCLUDE_DIR GL/gl.h
19 PATHS ${PC_OPENGL_gl_INCLUDEDIR})
20 find_library(OPENGL_gl_LIBRARY NAMES GL
21 PATHS ${PC_OPENGL_gl_LIBDIR})
22 find_library(OPENGL_glu_LIBRARY NAMES GLU
23 PATHS ${PC_OPENGL_glu_LIBDIR})
24else()
25 find_library(OPENGL_gl_LIBRARY NAMES OpenGL
26 PATHS ${CMAKE_OSX_SYSROOT}/System/Library
27 PATH_SUFFIXES Frameworks
28 NO_DEFAULT_PATH)
29 set(OPENGL_INCLUDE_DIR ${OPENGL_gl_LIBRARY}/Headers)
30 set(OPENGL_glu_LIBRARY ${OPENGL_gl_LIBRARY})
31endif()
32
33include(FindPackageHandleStandardArgs)
34find_package_handle_standard_args(OpenGl
35 REQUIRED_VARS OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY OPENGL_INCLUDE_DIR)
36
37if(OPENGL_FOUND)
38 set(OPENGL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
39 set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
40 set(OPENGL_DEFINITIONS -DHAVE_LIBGL=1)
41endif()
42
43mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY)