Skip to content

FindFreetype: use `freetype-config.cmake` if available

Ben Boeckel requested to merge ben.boeckel/cmake:FindFreetype-use-config into master

The official freetype-config.cmake provides Freetype::Freetype as an INTERFACE library to its exported freetype target. This ends up causing issues if CMake's Find module is used to define Freetype::Freetype before using freetype-config because some, but not all, of its defined targets are already available triggering the generated code that detects such situations.

Instead, try to use freetype-config where possible and provide bridge logic for this module's variable guarantees.

See vtk/vtk!10483 (merged).

Cc: @ryan.krattiger1

Merge request reports