| 1 |
# - Try to find Cairo |
| 2 |
# Once done, this will define |
| 3 |
# |
| 4 |
# Cairo_FOUND - system has Cairo |
| 5 |
# Cairo_INCLUDE_DIRS - the Cairo include directories |
| 6 |
# Cairo_LIBRARIES - link these to use Cairo |
| 7 |
|
| 8 |
include(LibFindMacros) |
| 9 |
|
| 10 |
# Freetype is not necessarily required on all platforms... |
| 11 |
if(NOT WIN32) |
| 12 |
set(cairo_needs_freetype true) |
| 13 |
endif(NOT WIN32) |
| 14 |
|
| 15 |
# Dependencies |
| 16 |
if(cairo_needs_freetype) |
| 17 |
libfind_package(Cairo Freetype) |
| 18 |
endif(cairo_needs_freetype) |
| 19 |
|
| 20 |
# Use pkg-config to get hints about paths |
| 21 |
libfind_pkg_check_modules(Cairo_PKGCONF cairo) |
| 22 |
|
| 23 |
# Include dir |
| 24 |
find_path(Cairo_INCLUDE_DIR |
| 25 |
NAMES cairo.h |
| 26 |
HINTS ${Cairo_PKGCONF_INCLUDE_DIRS} |
| 27 |
PATH_SUFFIXES cairo |
| 28 |
) |
| 29 |
|
| 30 |
# Finally the library itself |
| 31 |
find_library(Cairo_LIBRARY |
| 32 |
NAMES cairo |
| 33 |
HINTS ${Cairo_PKGCONF_LIBRARY_DIRS} |
| 34 |
) |
| 35 |
|
| 36 |
# Set the include dir variables and the libraries and let libfind_process do the rest. |
| 37 |
# NOTE: Singular variables for this library, plural for libraries this this lib depends on. |
| 38 |
set(Cairo_PROCESS_INCLUDES Cairo_INCLUDE_DIR) |
| 39 |
set(Cairo_PROCESS_LIBS Cairo_LIBRARY) |
| 40 |
|
| 41 |
libfind_process(Cairo) |