2021-03-07 02:40:21 +02:00
|
|
|
# Try to find libwebp, once done this will define:
|
2015-11-01 05:10:05 +02:00
|
|
|
#
|
|
|
|
# WEBP_FOUND - system has libwebp
|
|
|
|
# WEBP_INCLUDES - the libwebp include directory
|
2020-02-19 20:52:40 +00:00
|
|
|
# WEBP_LIBRARIES - the libraries needed to use libwebp
|
2015-11-01 05:10:05 +02:00
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2015 Ivailo Monev <xakepa10@gmail.com>
|
2015-11-01 05:10:05 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
2020-02-10 20:40:01 +00:00
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
2015-11-01 05:10:05 +02:00
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
2022-10-18 17:29:58 +03:00
|
|
|
pkg_check_modules(PC_WEBP QUIET libwebpdemux)
|
2020-02-10 20:40:01 +00:00
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
set(WEBP_INCLUDES ${PC_WEBP_INCLUDE_DIRS})
|
|
|
|
set(WEBP_LIBRARIES ${PC_WEBP_LIBRARIES})
|
2020-02-18 15:53:03 +00:00
|
|
|
set(WEBP_VERSION ${PC_WEBP_VERSION})
|
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
if(NOT WEBP_INCLUDES OR NOT WEBP_LIBRARIES)
|
|
|
|
find_path(WEBP_INCLUDES
|
2022-10-18 17:29:58 +03:00
|
|
|
NAMES encode.h decode.h demux.h
|
2020-02-10 20:40:01 +00:00
|
|
|
PATH_SUFFIXES webp
|
|
|
|
HINTS $ENV{WEBPDIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(WEBP_LIBRARIES
|
2022-10-18 17:29:58 +03:00
|
|
|
NAMES webpdemux
|
2020-02-10 20:40:01 +00:00
|
|
|
HINTS $ENV{WEBPDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2015-11-01 05:10:05 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-02-10 20:40:01 +00:00
|
|
|
find_package_handle_standard_args(WebP
|
2020-02-18 15:53:03 +00:00
|
|
|
VERSION_VAR WEBP_VERSION
|
2020-02-10 20:40:01 +00:00
|
|
|
REQUIRED_VARS WEBP_LIBRARIES WEBP_INCLUDES
|
|
|
|
)
|
2015-11-01 05:10:05 +02:00
|
|
|
|
|
|
|
mark_as_advanced(WEBP_INCLUDES WEBP_LIBRARIES)
|