initial import
[vuplus_webkit] / Source / cmake / FindCairo.cmake
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 # Dependencies
11 libfind_package(Cairo Freetype)
12
13 # Use pkg-config to get hints about paths
14 libfind_pkg_check_modules(Cairo_PKGCONF cairo)
15
16 # Include dir
17 find_path(Cairo_INCLUDE_DIR
18   NAMES cairo.h
19   PATHS ${Cairo_PKGCONF_INCLUDE_DIRS}
20 )
21
22 # Finally the library itself
23 find_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.
30 set(Cairo_PROCESS_INCLUDES Cairo_INCLUDE_DIR Freetype_INCLUDE_DIRS)
31 set(Cairo_PROCESS_LIBS Cairo_LIBRARY Freetype_LIBRARIES)
32 libfind_process(Cairo)
33