[libwebp] Deploy FindWebP.cmake

This commit is contained in:
Robert Schumacher 2018-02-21 16:42:23 -08:00
parent 832f908694
commit 5609d34b39
3 changed files with 30 additions and 1 deletions

View File

@ -1,3 +1,3 @@
Source: libwebp
Version: 0.6.1-1
Version: 0.6.1-2
Description: Lossy compression of digital photographic images.

View File

@ -0,0 +1,27 @@
include(SelectLibraryConfigurations)
include(FindPackageHandleStandardArgs)
# 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 webp/debug debug/webp)
select_library_configurations(WEBP)
endif()
SET(WEBP_LIBRARIES ${WEBP_LIBRARY})
SET(WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIR})
find_package_handle_standard_args(WEBP REQUIRED_VARS WEBP_LIBRARY WEBP_INCLUDE_DIR)

View File

@ -36,3 +36,5 @@ file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwe
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebp/COPYING ${CURRENT_PACKAGES_DIR}/share/libwebp/copyright)
vcpkg_copy_pdbs()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindWebP.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebp)