FindGIF.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # This module defines
  2. # GIF_LIBRARIES - libraries to link to in order to use GIF
  3. # GIF_FOUND, if false, do not try to link
  4. # GIF_INCLUDE_DIR, where to find the headers
  5. #
  6. # $GIF_DIR is an environment variable that would
  7. # correspond to the ./configure --prefix=$GIF_DIR
  8. # Created by Eric Wing.
  9. # Modifications by Alexander Neundorf
  10. FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
  11. PATHS
  12. $ENV{GIF_DIR}
  13. NO_DEFAULT_PATH
  14. PATH_SUFFIXES include
  15. )
  16. FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
  17. PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
  18. NO_DEFAULT_PATH
  19. PATH_SUFFIXES include
  20. )
  21. FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
  22. PATHS
  23. ~/Library/Frameworks
  24. /Library/Frameworks
  25. /sw/include # Fink
  26. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
  27. /usr/freeware/include
  28. )
  29. # the gif library can have many names :-/
  30. SET(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib)
  31. FIND_LIBRARY(GIF_LIBRARY
  32. NAMES ${POTENTIAL_GIF_LIBS}
  33. PATHS
  34. $ENV{GIF_DIR}
  35. NO_DEFAULT_PATH
  36. PATH_SUFFIXES lib64 lib
  37. )
  38. FIND_LIBRARY(GIF_LIBRARY
  39. NAMES ${POTENTIAL_GIF_LIBS}
  40. PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
  41. NO_DEFAULT_PATH
  42. PATH_SUFFIXES lib64 lib
  43. )
  44. FIND_LIBRARY(GIF_LIBRARY
  45. NAMES ${POTENTIAL_GIF_LIBS}
  46. PATHS
  47. ~/Library/Frameworks
  48. /Library/Frameworks
  49. /usr/local
  50. /usr
  51. /sw
  52. /opt/local
  53. /opt/csw
  54. /opt
  55. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]
  56. /usr/freeware
  57. PATH_SUFFIXES lib64 lib
  58. )
  59. # see readme.txt
  60. SET(GIF_LIBRARIES ${GIF_LIBRARY})
  61. # handle the QUIETLY and REQUIRED arguments and set GIF_FOUND to TRUE if
  62. # all listed variables are TRUE
  63. INCLUDE(FindPackageHandleStandardArgs)
  64. FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIF DEFAULT_MSG GIF_LIBRARY GIF_INCLUDE_DIR)
  65. MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARY)