Skip to content

Commit c8e4ffe

Browse files
authored
deps: Add build recipe for WebP (#4422)
As requested in #4387. --------- Signed-off-by: Zach Lewis <[email protected]> Signed-off-by: zachlewis <[email protected]>
1 parent a4098cf commit c8e4ffe

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

src/cmake/build_WebP.cmake

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright Contributors to the OpenImageIO project.
2+
# SPDX-License-Identifier: Apache-2.0
3+
# https://github.com/AcademySoftwareFoundation/OpenImageIO
4+
5+
######################################################################
6+
# WebP by hand!
7+
######################################################################
8+
9+
set_cache (WebP_BUILD_VERSION 1.4.0 "WebP version for local builds")
10+
set (WebP_GIT_REPOSITORY "https://github.com/webmproject/libwebp.git")
11+
set (WebP_GIT_TAG "v${WebP_BUILD_VERSION}")
12+
13+
set_cache (WebP_BUILD_SHARED_LIBS OFF
14+
DOC "Should execute a local WebP build; if necessary, build shared libraries" ADVANCED)
15+
16+
string (MAKE_C_IDENTIFIER ${WebP_BUILD_VERSION} WebP_VERSION_IDENT)
17+
18+
build_dependency_with_cmake(WebP
19+
VERSION ${WebP_BUILD_VERSION}
20+
GIT_REPOSITORY ${WebP_GIT_REPOSITORY}
21+
GIT_TAG ${WebP_GIT_TAG}
22+
CMAKE_ARGS
23+
-D BUILD_SHARED_LIBS=${WebP_BUILD_SHARED_LIBS}
24+
-D WEBP_BUILD_ANIM_UTILS=OFF
25+
-D WEBP_BUILD_CWEBP=OFF
26+
-D WEBP_BUILD_DWEBP=OFF
27+
-D WEBP_BUILD_GIF2WEBP=OFF
28+
-D WEBP_BUILD_IMG2WEBP=OFF
29+
-D WEBP_BUILD_VWEBP=OFF
30+
-D WEBP_BUILD_WEBPINFO=OFF
31+
-D WEBP_BUILD_WEBPMUX=OFF
32+
-D WEBP_BUILD_EXTRAS=OFF
33+
-D CMAKE_INSTALL_LIBDIR=lib
34+
)
35+
36+
# Set some things up that we'll need for a subsequent find_package to work
37+
set (WebP_ROOT ${WebP_LOCAL_INSTALL_DIR})
38+
39+
# Signal to caller that we need to find again at the installed location
40+
set (WebP_REFIND TRUE)
41+
set (WebP_REFIND_VERSION ${WebP_BUILD_VERSION})
42+
set (WebP_REFIND_ARGS CONFIG)
43+
44+
if (WebP_BUILD_SHARED_LIBS)
45+
install_local_dependency_libs (WebP WebP)
46+
endif ()

0 commit comments

Comments
 (0)