1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. # Copyright 2012 Benjamin Eikel
  8. #
  9. # Distributed under the OSI-approved BSD License (the "License");
  10. # see accompanying file Copyright.txt for details.
  11. #
  12. # This software is distributed WITHOUT ANY WARRANTY; without even the
  13. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. # See the License for more information.
  15. #=============================================================================
  16. # (To distribute this file outside of CMake, substitute the full
  17. # License text for the above reference.)
  18. find_package(PkgConfig)
  19. pkg_check_modules(PC_GLX QUIET glx)
  20. find_path(GLX_INCLUDE_DIR
  21. GL/glx.h
  22. HINTS ${PC_GLX_INCLUDEDIR} ${PC_GLX_INCLUDE_DIRS}
  23. )
  24. find_library(GLX_LIBRARY
  25. GL
  26. HINTS ${PC_GLX_LIBDIR} ${PC_GLX_LIBRARY_DIRS}
  27. )
  28. set(GLX_INCLUDE_DIRS ${GLX_INCLUDE_DIR})
  29. set(GLX_LIBRARIES ${GLX_LIBRARY})
  30. include(FindPackageHandleStandardArgs)
  31. find_package_handle_standard_args(GLX DEFAULT_MSG
  32. GLX_INCLUDE_DIR
  33. GLX_LIBRARY
  34. )
  35. mark_as_advanced(
  36. GLX_INCLUDE_DIR
  37. GLX_LIBRARY
  38. )