Skip to content
This repository was archived by the owner on Mar 22, 2020. It is now read-only.

Commit c255433

Browse files
committed
Use Hunter to download WebP
1 parent e0efb87 commit c255433

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

cmake/OpenCVFindLibsGrfmt.cmake

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,27 @@ if(WITH_WEBP)
131131
if(BUILD_WEBP)
132132
ocv_clear_vars(WEBP_FOUND WEBP_LIBRARY WEBP_LIBRARIES WEBP_INCLUDE_DIR)
133133
else()
134+
if(HUNTER_ENABLED)
135+
hunter_add_package(WebP)
136+
find_package(WebP CONFIG REQUIRED)
137+
set(WEBP_FOUND TRUE)
138+
set(HAVE_WEBP 1)
139+
set(WEBP_LIBRARY WebP::webp)
140+
set(WEBP_LIBRARIES ${WEBP_LIBRARY})
141+
142+
get_target_property(
143+
WEBP_INCLUDE_DIR
144+
WebP::webp
145+
INTERFACE_INCLUDE_DIRECTORIES
146+
)
147+
else()
148+
134149
include(cmake/OpenCVFindWebP.cmake)
135150
if(WEBP_FOUND)
136151
set(HAVE_WEBP 1)
137152
endif()
153+
154+
endif()
138155
endif()
139156
endif()
140157

cmake/templates/OpenCVConfig.cmake.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ if("@JASPER_FOUND@")
336336
find_dependency(jasper CONFIG)
337337
endif()
338338

339+
if("@WEBP_FOUND@")
340+
find_dependency(WebP CONFIG)
341+
endif()
342+
339343
# AWP: Qt5 dependencies -- start
340344
if("@Qt5Core_FOUND@")
341345
find_dependency(Qt5Core)

0 commit comments

Comments
 (0)