FindImageMagick — CMake 4.4.3 Documentation

# FindImageMagick

Finds ImageMagick, a software suite for displaying, converting, and manipulating raster images:

    find_package(ImageMagick [<version>] [COMPONENTS <components>...] [...])

Added in version 3.9: Support for ImageMagick 7.

## Components

This module supports components and searches for a set of ImageMagick tools. Typical components include the names of ImageMagick executables, but are not limited to the following (future versions of ImageMagick may provide additional components not listed here):

- `animate`

- `compare`

- `composite`

- `conjure`

- `convert`

- `display`

- `identify`

- `import`

- `mogrify`

- `montage`

- `stream`

There are also components for the following ImageMagick APIs:

`Magick++`

  Finds the ImageMagick C++ API.

`MagickWand`

  Finds the ImageMagick MagickWand C API.

`MagickCore`

  Finds the ImageMagick MagickCore low-level C API.

Components can be specified using the `find_package()` command:

    find_package(ImageMagick [COMPONENTS <components>...])

If no components are specified, the module only searches for the ImageMagick executable directory.

## Imported Targets

This module provides the following Imported Targets:

`ImageMagick::Magick++`

  Added in version 3.26.

  Target encapsulating the ImageMagick C++ API usage requirements, available if ImageMagick C++ is found.

`ImageMagick::MagickWand`

  Added in version 3.26.

  Target encapsulating the ImageMagick MagickWand C API usage requirements, available if MagickWand is found.

`ImageMagick::MagickCore`

  Added in version 3.26.

  Target encapsulating the ImageMagick MagickCore low-level C API usage requirements, available if MagickCore is found.

## Result Variables

This module defines the following variables:

`ImageMagick_FOUND`

  Boolean indicating whether (the requested version of) ImageMagick and all its requested components were found.

`ImageMagick_VERSION`

  Added in version 4.2.

  The version of ImageMagick found in form of `<major>.<minor>.<patch>-<addendum>` (e.g., `6.9.12-98`, where `98` is the addendum release number).

  Note

  Version detection is available only for ImageMagick 6 and later.

`ImageMagick_INCLUDE_DIRS`

  All include directories needed to use ImageMagick.

`ImageMagick_LIBRARIES`

  Libraries needed to link against to use ImageMagick.

`ImageMagick_COMPILE_OPTIONS`

  Added in version 3.26.

  Compile options of all libraries.

`ImageMagick_<component>_FOUND`

  Boolean indicating whether the ImageMagick `<component>` is found.

`ImageMagick_<component>_EXECUTABLE`

  The full path to `<component>` executable.

`ImageMagick_<component>_INCLUDE_DIRS`

  Include directories containing headers needed to use the ImageMagick `<component>`.

`ImageMagick_<component>_COMPILE_OPTIONS`

  Added in version 3.26.

  Compile options of the ImageMagick `<component>`.

`ImageMagick_<component>_LIBRARIES`

  Added in version 3.31.

  Libraries needed to link against to use the ImageMagick `<component>`.

## Cache Variables

The following cache variables may also be set:

`ImageMagick_EXECUTABLE_DIR`

  The full path to directory containing ImageMagick executables.

## Deprecated Variables

The following variables are provided for backward compatibility:

`ImageMagick_VERSION_STRING`

  Deprecated since version 4.2: Use `ImageMagick_VERSION`, which has the same value.

  The version of ImageMagick found.

## Examples

Finding ImageMagick with its component `Magick++` and linking it to a project target:

    find_package(ImageMagick COMPONENTS Magick++)
    target_link_libraries(example PRIVATE ImageMagick::Magick++)