aboutsummaryrefslogtreecommitdiff
path: root/cmake/modules/FindGLU.cmake
blob: f91d33deb62d34efcd2d673984e15dc702511666 (plain)
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
#.rst:
# FindGLU
# -----
# Finds the GLU library
#
# This will define the following variables::
#
# GLU_FOUND - system has GLU
# GLU_INCLUDE_DIRS - the GLU include directory
# GLU_LIBRARIES - the GLU libraries
# GLU_DEFINITIONS - the GLU definitions
#

if(PKG_CONFIG_FOUND)
  pkg_check_modules(PC_GLU glu QUIET)
endif()

find_path(GLU_INCLUDE_DIR NAMES GL/glu.h
                          PATHS ${PC_GLU_INCLUDEDIR})
find_library(GLU_LIBRARY NAMES GLU
                         PATHS ${PC_GLU_LIBDIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLU
                                  REQUIRED_VARS GLU_LIBRARY GLU_INCLUDE_DIR)

if(GLU_FOUND)
  set(GLU_LIBRARIES ${GLU_LIBRARY})
  set(GLU_INCLUDE_DIRS ${GLU_INCLUDE_DIR})
  set(GLU_DEFINITIONS -DHAS_GLU=1)
endif()

mark_as_advanced(GLU_INCLUDE_DIR GLU_LIBRARY)