OpenCVFindWebP.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #=============================================================================
  2. # Find WebP library
  3. #=============================================================================
  4. # Find the native WebP headers and libraries.
  5. #
  6. # WEBP_INCLUDE_DIRS - where to find webp/decode.h, etc.
  7. # WEBP_LIBRARIES - List of libraries when using webp.
  8. # WEBP_FOUND - True if webp is found.
  9. #=============================================================================
  10. # Look for the header file.
  11. unset(WEBP_FOUND)
  12. FIND_PATH(WEBP_INCLUDE_DIR NAMES webp/decode.h)
  13. if(NOT WEBP_INCLUDE_DIR)
  14. unset(WEBP_FOUND)
  15. else()
  16. MARK_AS_ADVANCED(WEBP_INCLUDE_DIR)
  17. # Look for the library.
  18. FIND_LIBRARY(WEBP_LIBRARY NAMES webp)
  19. MARK_AS_ADVANCED(WEBP_LIBRARY)
  20. # handle the QUIETLY and REQUIRED arguments and set WEBP_FOUND to TRUE if
  21. # all listed variables are TRUE
  22. INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
  23. FIND_PACKAGE_HANDLE_STANDARD_ARGS(WebP DEFAULT_MSG WEBP_LIBRARY WEBP_INCLUDE_DIR)
  24. SET(WEBP_LIBRARIES ${WEBP_LIBRARY})
  25. SET(WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIR})
  26. endif()