File: FindGLX.cmake

package info (click to toggle)
slop 7.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 568 kB
  • sloc: cpp: 3,371; makefile: 3
file content (44 lines) | stat: -rw-r--r-- 1,314 bytes parent folder | download | duplicates (11)
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 GLX. Once done, this will define:
#
#   GLX_FOUND - variable which returns the result of the search
#   GLX_INCLUDE_DIRS - list of include directories
#   GLX_LIBRARIES - options for the linker

#=============================================================================
# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
#  License text for the above reference.)

find_package(PkgConfig)
pkg_check_modules(PC_GLX QUIET glx)

find_path(GLX_INCLUDE_DIR
    GL/glx.h
    HINTS ${PC_GLX_INCLUDEDIR} ${PC_GLX_INCLUDE_DIRS}
)
find_library(GLX_LIBRARY
    GL
    HINTS ${PC_GLX_LIBDIR} ${PC_GLX_LIBRARY_DIRS}
)

set(GLX_INCLUDE_DIRS ${GLX_INCLUDE_DIR})
set(GLX_LIBRARIES ${GLX_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLX DEFAULT_MSG
    GLX_INCLUDE_DIR
    GLX_LIBRARY
)

mark_as_advanced(
    GLX_INCLUDE_DIR
    GLX_LIBRARY
)