Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindFreeGLUT.cmake 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright (C) 2007-2009 LuaDist.
  2. # Created by Peter Kapec <kapecp@gmail.com>
  3. # Redistribution and use of this file is allowed according to the terms of the MIT license.
  4. # For details see the COPYRIGHT file distributed with LuaDist.
  5. # Note:
  6. # Searching headers and libraries is very simple and is NOT as powerful as scripts
  7. # distributed with CMake, because LuaDist defines directories to search for.
  8. # Everyone is encouraged to contact the author with improvements. Maybe this file
  9. # becomes part of CMake distribution sometimes.
  10. # - Find FreeGLUT
  11. # Find the native FreeGLUT headers and libraries.
  12. #
  13. # FREEGLUT_INCLUDE_DIRS - where to find freeglut.h, etc.
  14. # FREEGLUT_LIBRARIES - List of libraries when using FreeGLUT.
  15. # FREEGLUT_FOUND - True if FreeGLUT found.
  16. # 2014-10-08 Thomas Buck <xythobuz@xythobuz.de>:
  17. # Fix to work on Mac OS X
  18. # Look for the header file.
  19. FIND_PATH(FREEGLUT_INCLUDE_DIR NAMES GL/freeglut.h
  20. PATHS /opt/local/include
  21. )
  22. # Look for the library.
  23. IF(APPLE)
  24. # We don't want to use the GLUT shipping with OS X
  25. FIND_LIBRARY(FREEGLUT_LIBRARY NAMES freeglut glut
  26. PATHS /opt/local/lib
  27. NO_DEFAULT_PATH
  28. )
  29. ELSE(APPLE)
  30. FIND_LIBRARY(FREEGLUT_LIBRARY NAMES freeglut)
  31. ENDIF(APPLE)
  32. # Handle the QUIETLY and REQUIRED arguments and set FREEGLUT_FOUND to TRUE if all listed variables are TRUE.
  33. INCLUDE(FindPackageHandleStandardArgs)
  34. FIND_PACKAGE_HANDLE_STANDARD_ARGS(FREEGLUT DEFAULT_MSG FREEGLUT_LIBRARY FREEGLUT_INCLUDE_DIR)
  35. # Copy the results to the output variables.
  36. IF(FREEGLUT_FOUND)
  37. SET(FREEGLUT_LIBRARIES ${FREEGLUT_LIBRARY})
  38. SET(FREEGLUT_INCLUDE_DIRS ${FREEGLUT_INCLUDE_DIR})
  39. ELSE(FREEGLUT_FOUND)
  40. SET(FREEGLUT_LIBRARIES)
  41. SET(FREEGLUT_INCLUDE_DIRS)
  42. ENDIF(FREEGLUT_FOUND)
  43. MARK_AS_ADVANCED(FREEGLUT_INCLUDE_DIRS FREEGLUT_LIBRARIES)