• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
8include(LibFindMacros)
9
10# Dependencies
11libfind_package(Cairo Freetype)
12
13# Use pkg-config to get hints about paths
14libfind_pkg_check_modules(Cairo_PKGCONF cairo)
15
16# Include dir
17find_path(Cairo_INCLUDE_DIR
18  NAMES cairo.h
19  PATHS ${Cairo_PKGCONF_INCLUDE_DIRS}
20)
21
22# Finally the library itself
23find_library(Cairo_LIBRARY
24  NAMES cairo
25  PATHS ${Cairo_PKGCONF_LIBRARY_DIRS}
26)
27
28# Set the include dir variables and the libraries and let libfind_process do the rest.
29# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
30set(Cairo_PROCESS_INCLUDES Cairo_INCLUDE_DIR Freetype_INCLUDE_DIRS)
31set(Cairo_PROCESS_LIBS Cairo_LIBRARY Freetype_LIBRARIES)
32libfind_process(Cairo)
33
34