@@ -70,6 +70,46 @@ if(NOT HAVE_MATH_LIBRARY)
7070 list (APPEND WEBP_DEP_LIBRARIES m)
7171endif ()
7272
73+ if (HUNTER_ENABLED)
74+ hunter_add_package(PNG)
75+ find_package (PNG CONFIG REQUIRED)
76+ list (APPEND WEBP_DEP_IMG_LIBRARIES PNG::png)
77+ set (WEBP_HAVE_PNG 1)
78+ set (PNG_FOUND 1)
79+
80+ hunter_add_package(Jpeg)
81+ find_package (JPEG CONFIG REQUIRED)
82+ list (APPEND WEBP_DEP_IMG_LIBRARIES JPEG::jpeg)
83+ set (WEBP_HAVE_JPEG 1)
84+ set (JPEG_FOUND 1)
85+
86+ if (MSYS)
87+ # TIFF is currently not supported by Hunter on MSYS:
88+ # - https://github.com/ingenue/hunter/blob/8e37b969b18ff75857d2b75c8acdf1e9caca2549/appveyor.yml#L31-L34
89+ set (WEBP_HAVE_TIFF 0)
90+ set (TIFF_FOUND 0)
91+ else ()
92+ hunter_add_package(TIFF)
93+ find_package (TIFF CONFIG REQUIRED)
94+ list (APPEND WEBP_DEP_IMG_LIBRARIES TIFF::libtiff)
95+ set (WEBP_HAVE_TIFF 1)
96+ set (TIFF_FOUND 1)
97+ endif ()
98+
99+ if (MINGW OR MSYS)
100+ # giflib is currently not supported by Hunter on MinGW and MSYS:
101+ # - https://github.com/ingenue/hunter/blob/ab5a2b7507427b2e1110717c35c29a78815394c6/appveyor.yml#L27-L37
102+ set (WEBP_HAVE_GIF 0)
103+ set (GIF_FOUND 0)
104+ else ()
105+ hunter_add_package(giflib)
106+ find_package (giflib CONFIG REQUIRED)
107+ list (APPEND WEBP_DEP_GIF_LIBRARIES giflib::giflib)
108+ set (WEBP_HAVE_GIF 1)
109+ set (GIF_FOUND 1)
110+ endif ()
111+ else ()
112+
73113# Find the standard image libraries.
74114set (WEBP_DEP_IMG_LIBRARIES)
75115set (WEBP_DEP_IMG_INCLUDE_DIRS)
@@ -116,6 +156,8 @@ if(GIF_FOUND)
116156 endif ()
117157endif ()
118158
159+ endif ()
160+
119161# Check for specific headers.
120162include (CheckIncludeFiles)
121163check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
0 commit comments