File: FindCairo.cmake

package info (click to toggle)
openbabel 2.4.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 58,308 kB
  • sloc: cpp: 459,210; ansic: 90,514; php: 13,963; python: 7,899; perl: 6,518; pascal: 793; sh: 179; xml: 97; ruby: 64; makefile: 46; java: 23; cs: 14
file content (51 lines) | stat: -rw-r--r-- 1,438 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# - try to find Cairo
# Once done this will define
#
#  CAIRO_FOUND - system has Cairo
#  CAIRO_CFLAGS - the Cairo CFlags
#  CAIRO_INCLUDE_DIRS - the Cairo include directories
#  CAIRO_LIBRARIES - Link these to use Cairo
#
# Copyright (C) 2007, 2010, Pino Toscano, <pino@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.

if(CAIRO_INCLUDE_DIRS AND CAIRO_LIBRARIES)

  # in cache already
  set(CAIRO_FOUND TRUE)

else(CAIRO_INCLUDE_DIRS AND CAIRO_LIBRARIES)

  if(NOT WIN32)
    # use pkg-config to get the directories and then use these values
    # in the FIND_PATH() and FIND_LIBRARY() calls
    find_package(PkgConfig)
    if(Cairo_FIND_VERSION_COUNT GREATER 0)
      set(_cairo_version_cmp ">=${Cairo_FIND_VERSION}")
    endif(Cairo_FIND_VERSION_COUNT GREATER 0)
    pkg_check_modules(_pc_cairo cairo${_cairo_version_cmp})
  endif(NOT WIN32)

  find_library(CAIRO_LIBRARY cairo
               HINTS ${_pc_cairo_LIBRARY_DIRS}
  )
  set(CAIRO_LIBRARIES "${CAIRO_LIBRARY}")

  find_path(CAIRO_INCLUDE_DIR cairo.h
            HINTS ${_pc_cairo_INCLUDE_DIRS}
            PATH_SUFFIXES cairo
  )
  set(CAIRO_INCLUDE_DIRS "${CAIRO_INCLUDE_DIR}")

  include(FindPackageHandleStandardArgs)
  find_package_handle_standard_args(Cairo DEFAULT_MSG CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS)

endif(CAIRO_INCLUDE_DIRS AND CAIRO_LIBRARIES)

mark_as_advanced(
  CAIRO_CFLAGS
  CAIRO_INCLUDE_DIRS
  CAIRO_LIBRARIES
)