aboutsummaryrefslogtreecommitdiff
path: root/ports/leptonica/fix-find-libwebp.patch
blob: 588cf0c5480374afdca160a0c13b1ab18972b9d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6535632..1740841 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,8 +70,7 @@ if(NOT SW_BUILD)
         pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)
     endif()
     if(NOT WEBP)
-        find_path(WEBP_INCLUDE_DIR /webp/decode.h)
-        find_library(WEBP_LIBRARY NAMES webp)
+        find_package(WebP CONFIG REQUIRED)
         if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
             set(WEBP 1)
             set(WEBP_FOUND TRUE)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d2b999d..019ec7b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -52,7 +52,7 @@ if (TIFF_LIBRARIES)
 endif()
 if (WEBP_FOUND)
     target_include_directories  (leptonica PUBLIC ${WEBP_INCLUDE_DIRS})
-    target_link_libraries       (leptonica ${WEBP_LIBRARIES})
+    target_link_libraries       (leptonica WebP::webp WebP::libwebpmux)
 endif()
 if (ZLIB_LIBRARIES)
     target_include_directories  (leptonica PUBLIC ${ZLIB_INCLUDE_DIRS})