Merge pull request #26857 from hmaarrfk:patch-1

Update OpenCVFindWebP.cmake with sturkmen72's suggestion
This commit is contained in:
Alexander Smorkalov 2025-02-01 09:16:57 +03:00 committed by GitHub
commit 43cebe52eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,10 +10,17 @@
# Look for the header file.
FIND_PATH(WEBP_INCLUDE_DIR NAMES webp/decode.h)
unset(WEBP_FOUND)
if(NOT WEBP_INCLUDE_DIR)
unset(WEBP_FOUND)
find_package(WebP QUIET)
if(TARGET WebP::webp AND TARGET WebP::webpdemux AND TARGET WebP::libwebpmux)
MARK_AS_ADVANCED(WEBP_INCLUDE_DIR)
MARK_AS_ADVANCED(WEBP_LIBRARY)
SET(WEBP_FOUND TRUE)
SET(WEBP_LIBRARY WebP)
SET(WEBP_INCLUDE_DIR)
else()
MARK_AS_ADVANCED(WEBP_INCLUDE_DIR)