FindWebP.cmake 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #.rst:
  2. # FindWebP
  3. # ------------
  4. #
  5. # Locate webp library
  6. #
  7. # This module defines
  8. #
  9. # ::
  10. #
  11. # WEBP_LIBRARIES, the library to link against
  12. # WEBP_FOUND, if false, do not try to link to FREETYPE
  13. # WEBP_INCLUDE_DIRS, where to find headers.
  14. # This is the concatenation of the paths:
  15. # WEBP_INCLUDE_DIR
  16. #
  17. #=============================================================================
  18. # Copyright 2014-2014 Martell Malone
  19. #
  20. # Distributed under the OSI-approved BSD License (the "License");
  21. # see accompanying file Copyright.txt for details.
  22. #
  23. # This software is distributed WITHOUT ANY WARRANTY; without even the
  24. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  25. # See the License for more information.
  26. #=============================================================================
  27. # (To distribute this file outside of CMake, substitute the full
  28. # License text for the above reference.)
  29. FIND_PATH(WEBP_INCLUDE_DIR decode.h
  30. HINTS
  31. ENV WEBP_DIR
  32. PATH_SUFFIXES include/webp include
  33. PATHS
  34. ~/Library/Frameworks
  35. /Library/Frameworks
  36. /usr/local
  37. /usr
  38. /sw # Fink
  39. /opt/local # DarwinPorts
  40. /opt/csw # Blastwave
  41. /opt
  42. )
  43. FIND_LIBRARY(WEBP_LIBRARY
  44. NAMES webp libwebp
  45. HINTS
  46. ENV WEBP_DIR
  47. PATH_SUFFIXES lib
  48. PATHS
  49. ~/Library/Frameworks
  50. /Library/Frameworks
  51. /usr/local
  52. /usr
  53. /sw
  54. /opt/local
  55. /opt/csw
  56. /opt
  57. )
  58. set(WEBP_INCLUDE_DIRS "${WEBP_INCLUDE_DIR}")
  59. set(WEBP_LIBRARIES "${WEBP_LIBRARY}")
  60. INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  61. # handle the QUIETLY and REQUIRED arguments and set WEBP_FOUND to TRUE if
  62. # all listed variables are TRUE
  63. FIND_PACKAGE_HANDLE_STANDARD_ARGS(WebP DEFAULT_MSG WEBP_LIBRARIES WEBP_INCLUDE_DIR)
  64. MARK_AS_ADVANCED(WEBP_INCLUDE_DIR WEBP_LIBRARIES WEBP_LIBRARY)