[cosmetic] separate c-lang format commit
[xbmc.git] / cmake / modules / FindGLU.cmake
blob68ec1eb2eb77aa3f4a4e4049f1d709ad6497766c
1 #.rst:
2 # FindGLU
3 # -----
4 # Finds the GLU library
6 # This will define the following target:
8 #   ${APP_NAME_LC}::GLU   - The GLU library
10 if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME})
12   find_package(PkgConfig)
14   if(PKG_CONFIG_FOUND)
15     pkg_check_modules(PC_GLU glu QUIET)
16   endif()
18   find_path(GLU_INCLUDE_DIR NAMES GL/glu.h
19                             HINTS ${PC_GLU_INCLUDEDIR})
20   find_library(GLU_LIBRARY NAMES GLU
21                            HINTS ${PC_GLU_LIBDIR})
23   include(FindPackageHandleStandardArgs)
24   find_package_handle_standard_args(GLU
25                                     REQUIRED_VARS GLU_LIBRARY GLU_INCLUDE_DIR)
27   if(GLU_FOUND)
28     add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} UNKNOWN IMPORTED)
29     set_target_properties(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} PROPERTIES
30                                                                      IMPORTED_LOCATION "${GLU_LIBRARY}"
31                                                                      INTERFACE_INCLUDE_DIRECTORIES "${GLU_INCLUDE_DIR}")
32   endif()
34 endif()