Commit 5a119187 authored by Stefano Sinigardi's avatar Stefano Sinigardi
Browse files

add FindWebP

parent a4e7538a
Pipeline #92429 passed with stage
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#
#.rst:
# FindWebP
# ----------
#
# Try to find the WebP library
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# ``WEBP_INCLUDE_DIR``
# where to find library headers
#
# ``WEBP_LIBRARY``
# Library when using WebP
#
# ``WEBP_FOUND``
# True if WebP is found
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# If the user has provided ``WEBP_ROOT``, use it! Choose items found
# at this location over system locations.
if( EXISTS "$ENV{WEBP_ROOT}" )
file( TO_CMAKE_PATH "$ENV{WEBP_ROOT}" WEBP_ROOT )
set( WEBP_ROOT "${WEBP_ROOT}" CACHE PATH "Prefix for WebP installation." )
elseif(EXISTS "$ENV{WEBP_DIR}" )
file( TO_CMAKE_PATH "$ENV{WEBP_DIR}" WEBP_ROOT )
set( WEBP_ROOT "${WEBP_ROOT}" CACHE PATH "Prefix for WebP installation." )
endif()
if(NOT WEBP_INCLUDE_DIR)
FIND_PATH(WEBP_INCLUDE_DIR NAMES webp/decode.h)
endif()
if(NOT WEBP_LIBRARY)
find_library(WEBP_LIBRARY_RELEASE NAMES webp PATHS ${WEBP_ROOT} PATH_SUFFIXES webp )
find_library(WEBP_LIBRARY_DEBUG NAMES webpd PATHS ${WEBP_ROOT} PATH_SUFFIXES debug webp )
select_library_configurations(WEBP)
endif()
find_package_handle_standard_args(WEBP REQUIRED_VARS WEBP_LIBRARY WEBP_INCLUDE_DIR)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment