blob: 0344c691a06c0c9f6b6e3bf122485d3e40b19d55 (
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
From 848e031f0289c7fd67c2d6d098de26e479a40adb Mon Sep 17 00:00:00 2001
From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
Date: Sun, 10 Jul 2022 20:14:00 +0300
Subject: [PATCH] Use shared webp library
Added option -DUSE_SHARED_WEBP
---
CMakeLists.txt | 13 ++++++++++---
third_party/CMakeLists.txt | 34 ++++++++++++++++++----------------
2 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 306049917..0196a47f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,6 +56,7 @@ option(USE_SHARED_LIBARCHIVE "Use your installed copy of libarchive" off)
option(USE_SHARED_LIBPNG "Use your installed copy of libpng" off)
option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off)
option(USE_SHARED_PIXMAN "Use your installed copy of pixman" off)
+option(USE_SHARED_WEBP "User your installed copy of webp" off)
option(USE_SHARED_FREETYPE "Use shared FreeType library" off)
option(USE_SHARED_HARFBUZZ "Use shared HarfBuzz library" off)
option(ENABLE_ASEPRITE_EXE "Compile main Aseprite executable" on)
@@ -241,9 +242,15 @@ add_definitions(-DPNG_NO_MMX_CODE) # Do not use MMX optimizations in PNG code
# libwebp
if(ENABLE_WEBP)
- set(WEBP_LIBRARIES webp webpdemux libwebpmux)
- set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src)
- include_directories(${WEBP_INCLUDE_DIR})
+ if(USE_SHARED_WEBP)
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(WEBP libwebp libwebpdemux libwebpmux)
+ include_directories(${WEBP_INCLUDE_DIR})
+ else()
+ set(WEBP_LIBRARIES webp webpdemux libwebpmux)
+ set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src)
+ include_directories(${WEBP_INCLUDE_DIR})
+ endif()
endif()
# tinyxml
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index f499545b6..6855fd6db 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -34,22 +34,24 @@ if(NOT USE_SHARED_GIFLIB)
endif()
if(ENABLE_WEBP)
- set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.")
- set(WEBP_BUILD_ANIM_UTILS OFF CACHE BOOL "Build animation utilities.")
- set(WEBP_BUILD_CWEBP OFF CACHE BOOL "Build the cwebp command line tool.")
- set(WEBP_BUILD_DWEBP OFF CACHE BOOL "Build the dwebp command line tool.")
- set(WEBP_BUILD_GIF2WEBP OFF CACHE BOOL "Build the gif2webp conversion tool.")
- set(WEBP_BUILD_IMG2WEBP OFF CACHE BOOL "Build the img2webp animation tool.")
- set(WEBP_BUILD_VWEBP OFF CACHE BOOL "Build the vwebp viewer tool.")
- set(WEBP_BUILD_WEBPINFO OFF CACHE BOOL "Build the webpinfo command line tool.")
- set(WEBP_BUILD_WEBPMUX OFF CACHE BOOL "Build the webpmux command line tool.")
-
- add_subdirectory(libwebp)
-
- if(NOT USE_SHARED_LIBPNG)
- add_dependencies(webp ${PNG_LIBRARY})
- add_dependencies(webpdemux ${PNG_LIBRARY})
- add_dependencies(libwebpmux ${PNG_LIBRARY})
+ if(NOT USE_SHARED_WEBP)
+ set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.")
+ set(WEBP_BUILD_ANIM_UTILS OFF CACHE BOOL "Build animation utilities.")
+ set(WEBP_BUILD_CWEBP OFF CACHE BOOL "Build the cwebp command line tool.")
+ set(WEBP_BUILD_DWEBP OFF CACHE BOOL "Build the dwebp command line tool.")
+ set(WEBP_BUILD_GIF2WEBP OFF CACHE BOOL "Build the gif2webp conversion tool.")
+ set(WEBP_BUILD_IMG2WEBP OFF CACHE BOOL "Build the img2webp animation tool.")
+ set(WEBP_BUILD_VWEBP OFF CACHE BOOL "Build the vwebp viewer tool.")
+ set(WEBP_BUILD_WEBPINFO OFF CACHE BOOL "Build the webpinfo command line tool.")
+ set(WEBP_BUILD_WEBPMUX OFF CACHE BOOL "Build the webpmux command line tool.")
+
+ add_subdirectory(libwebp)
+
+ if(NOT USE_SHARED_LIBPNG)
+ add_dependencies(webp ${PNG_LIBRARY})
+ add_dependencies(webpdemux ${PNG_LIBRARY})
+ add_dependencies(libwebpmux ${PNG_LIBRARY})
+ endif()
endif()
endif()
--
2.35.1
|