1# Try to find GLX. Once done, this will define:
2#
3#   GLX_FOUND - variable which returns the result of the search
4#   GLX_INCLUDE_DIRS - list of include directories
5#   GLX_LIBRARIES - options for the linker
6
7#=============================================================================
8# Copyright 2012 Benjamin Eikel
9#
10# Distributed under the OSI-approved BSD License (the "License");
11# see accompanying file Copyright.txt for details.
12#
13# This software is distributed WITHOUT ANY WARRANTY; without even the
14# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15# See the License for more information.
16#=============================================================================
17# (To distribute this file outside of CMake, substitute the full
18#  License text for the above reference.)
19
20find_package(PkgConfig)
21pkg_check_modules(PC_GLX QUIET glx)
22
23find_path(GLX_INCLUDE_DIR
24    GL/glx.h
25    HINTS ${PC_GLX_INCLUDEDIR} ${PC_GLX_INCLUDE_DIRS}
26)
27find_library(GLX_LIBRARY
28    GL
29    HINTS ${PC_GLX_LIBDIR} ${PC_GLX_LIBRARY_DIRS}
30)
31
32set(GLX_INCLUDE_DIRS ${GLX_INCLUDE_DIR})
33set(GLX_LIBRARIES ${GLX_LIBRARY})
34
35include(FindPackageHandleStandardArgs)
36find_package_handle_standard_args(GLX DEFAULT_MSG
37    GLX_INCLUDE_DIR
38    GLX_LIBRARY
39)
40
41mark_as_advanced(
42    GLX_INCLUDE_DIR
43    GLX_LIBRARY
44)
45