| Version: 3.3.1

wxImage support for the WebP image format with libwebp

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.

# Unix-like operating system

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.

## Use libwebp with configure

Provided, `pkg-config` is available and the appropriate files are in the default locations, ``./configure will automatically detect the availability of libwebp.

## Use libwebp with CMake

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.

## MSW with vcpkg and MSVC

You can use Microsoft vcpkg tool (see https://github.com/Microsoft/vcpkg) to build and install libwebp:

> git clone https://github.com/Microsoft/vcpkg.git
> .\vcpkg\bootstrap-vcpkg.bat
> .\vcpkg\vcpkg.exe install libwebp:x64-windows-static

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.

## MSW with vcpkg and clang

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.