Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Add build recipe for WebP #4422

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
1 change: 0 additions & 1 deletion THIRD-PARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,3 @@ Public domain
-------------------------------------------------------------------------

If we have left anything out, it is unintentional. Please let us know.

46 changes: 46 additions & 0 deletions src/cmake/build_WebP.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright Contributors to the OpenImageIO project.
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

######################################################################
# WebP by hand!
######################################################################

set_cache (WebP_BUILD_VERSION 1.4.0 "WebP version for local builds")
set (WebP_GIT_REPOSITORY "https://github.com/webmproject/libwebp.git")
set (WebP_GIT_TAG "v${WebP_BUILD_VERSION}")

set_cache (WebP_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT}
DOC "Should execute a local WebP build; if necessary, build shared libraries" ADVANCED)

string (MAKE_C_IDENTIFIER ${WebP_BUILD_VERSION} WebP_VERSION_IDENT)

build_dependency_with_cmake(WebP
VERSION ${WebP_BUILD_VERSION}
GIT_REPOSITORY ${WebP_GIT_REPOSITORY}
GIT_TAG ${WebP_GIT_TAG}
CMAKE_ARGS
-D BUILD_SHARED_LIBS=${WebP_BUILD_SHARED_LIBS}
-D WEBP_BUILD_ANIM_UTILS=OFF
-D WEBP_BUILD_CWEBP=OFF
-D WEBP_BUILD_DWEBP=OFF
-D WEBP_BUILD_GIF2WEBP=OFF
-D WEBP_BUILD_IMG2WEBP=OFF
-D WEBP_BUILD_VWEBP=OFF
-D WEBP_BUILD_WEBPINFO=OFF
-D WEBP_BUILD_WEBPMUX=OFF
-D WEBP_BUILD_EXTRAS=OFF
-D CMAKE_INSTALL_LIBDIR=lib
)

# Set some things up that we'll need for a subsequent find_package to work
set (WebP_ROOT ${WebP_LOCAL_INSTALL_DIR})

# Signal to caller that we need to find again at the installed location
set (WebP_REFIND TRUE)
set (WebP_REFIND_VERSION ${WebP_BUILD_VERSION})
set (WebP_REFIND_ARGS CONFIG)

if (WebP_BUILD_SHARED_LIBS)
install_local_dependency_libs (WebP WebP)
endif ()
Loading