To make use of the wxWEBPHandler, libwebp library is required when building wxWidgets.
libwebp is available under a BSD license.
This guide explains how to obtain libwebp and let wxWidgets build system use it. The exact steps depend on the operating system and compiler used, please refer to the section appropriate for your environment below.
Under many Unix or Unix-like systems, libwebp is available as a system package and the simplest thing to do is to just install it using the system-specific tool (apt, pacman, ...). Just note that you may need to install the libwebp-dev package in order to obtain the library headers and not just the library itself.
Building libwebp from source is not part of this guide.
Provided, pkg-config
is available and the appropriate files are in the default locations, ./configure will automatically detect the availability of libwebp.
When using CMake, the built-in libwebp is enabled by default. To use the system version, add -DwxUSE_LIBWEBP=sys
to the commandline or change it in the GUI. Use -DwxUSE_LIBWEBP=OFF
to disable libwebp.
Note: At time of writing, the WebPConfig.cmake
file supplied by libwebp is affected by a bug. You may need to add the line set(WebP_INCLUDE_DIRS ${WebP_INCLUDE_DIR})
locally.
You can use Microsoft vcpkg tool (see https://github.com/Microsoft/vcpkg) to build and install libwebp:
You can then proceed to configure wxWidgets with CMake for building with MSVC, see Use libwebp with CMake.
Dynamic builds have not been tested. x86 builds have not been tested.
Refer to MSW with vcpkg and MSVC, but select x64-mingw-static
instead of x64-windows-static
. Then proceed as documented in Use libwebp with CMake or Use libwebp with configure . CMake can work as well as configure since vcpkg provides libwebp with support for both systems.