diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-02-21 16:42:23 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-02-23 17:06:37 -0800 |
| commit | 5609d34b39009a2b511ae85ee5d8484d1db514c5 (patch) | |
| tree | cf7f30deef4fb7e8b1628907b850b383bb67f23d /ports/libwebp | |
| parent | 832f908694423ccf4c32d8e0dc430cc9159e309b (diff) | |
| download | vcpkg-5609d34b39009a2b511ae85ee5d8484d1db514c5.tar.gz vcpkg-5609d34b39009a2b511ae85ee5d8484d1db514c5.zip | |
[libwebp] Deploy FindWebP.cmake
Diffstat (limited to 'ports/libwebp')
| -rw-r--r-- | ports/libwebp/CONTROL | 2 | ||||
| -rw-r--r-- | ports/libwebp/FindWebP.cmake | 27 | ||||
| -rw-r--r-- | ports/libwebp/portfile.cmake | 2 |
3 files changed, 30 insertions, 1 deletions
diff --git a/ports/libwebp/CONTROL b/ports/libwebp/CONTROL index 42201b36b..3e3ae16d8 100644 --- a/ports/libwebp/CONTROL +++ b/ports/libwebp/CONTROL @@ -1,3 +1,3 @@ Source: libwebp -Version: 0.6.1-1 +Version: 0.6.1-2 Description: Lossy compression of digital photographic images. diff --git a/ports/libwebp/FindWebP.cmake b/ports/libwebp/FindWebP.cmake new file mode 100644 index 000000000..c39a0eb05 --- /dev/null +++ b/ports/libwebp/FindWebP.cmake @@ -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) diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake index 3c16eccbb..e1baf1401 100644 --- a/ports/libwebp/portfile.cmake +++ b/ports/libwebp/portfile.cmake @@ -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) |
