FindGIF — CMake 4.3.2 Documentation

# FindGIF

Finds the Graphics Interchange Format (GIF) library (`giflib`):

    find_package(GIF [<version>] [...])

## Imported Targets

This module provides the following Imported Targets:

`GIF::GIF`

  Added in version 3.14.

  Target that encapsulates the usage requirements of the GIF library, available when the library is found.

## Result Variables

This module defines the following variables:

`GIF_FOUND`

  Boolean indicating whether the (requested version of) GIF library was found.

`GIF_VERSION`

  Version string of the GIF library found (for example, `5.1.4`). For GIF library versions prior to 4.1.6, version string will be set only to `3` or `4` as these versions did not provide version information in their headers.

`GIF_INCLUDE_DIRS`

  Include directories needed to use the GIF library.

`GIF_LIBRARIES`

  Libraries needed to link to the GIF library.

## Cache Variables

The following cache variables may also be set:

`GIF_INCLUDE_DIR`

  Directory containing the `gif_lib.h` and other GIF library headers.

`GIF_LIBRARY`

  Path to the GIF library.

## Hints

This module accepts the following variables:

`GIF_DIR`

  Environment variable that can be set to help locate a GIF library installed in a custom location. It should point to the installation destination that was used when configuring, building, and installing GIF library: `./configure --prefix=$GIF_DIR`.

## Examples

Finding GIF library and linking it to a project target:

    find_package(GIF)
    target_link_libraries(project_target PRIVATE GIF::GIF)