File: FindRSVG.cmake

package info (click to toggle)
t4kcommon 0.1.1-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,472 kB
  • sloc: sh: 10,688; ansic: 7,087; makefile: 102; sed: 16
file content (60 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (7)
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
52
53
54
55
56
57
58
59
60
# - Locate RSVG and Cairo library
# This module defines
# RSVG_FOUND if false, don't use RSVG
# CAIRO_FOUND if libcairo was found
# RSVG_LIBRARIES
# RSVG_CFLAGS
# CAIRO_CFLAGS



set(RSVG_FOUND false)

# first try using pkg-config
if (UNIX)
  include(FindPkgConfig)
  pkg_check_modules(RSVG librsvg-2.0)
  if(RSVG_FOUND)
    pkg_check_modules(CAIRO cairo)
    if(CAIRO_FOUND)
      set(HAVE_RSVG 1)  # For the config.h file
    endif(CAIRO_FOUND)
  endif(RSVG_FOUND)
endif(UNIX)

if (NOT RSVG_FOUND)
  find_path(RSVG_INCLUDE_DIR rsvg.h
    /usr/include
    /usr/include/librsvg-2
    /usr/include/librsvg-2/librsvg
    /usr/local/include
    /usr/local/include/librsvg-2
    /usr/local/include/librsvg-2/librsvg
  )
endif(NOT RSVG_FOUND)


# getting rid of semicolons
set(_rsvg_cflags "")
foreach(f ${RSVG_CFLAGS})
  set(_rsvg_cflags "${_rsvg_cflags} ${f}")
endforeach(f)
set(RSVG_CFLAGS ${_rsvg_cflags})

set(_cairo_cflags "")
foreach(f ${CAIRO_CFLAGS})
  set(_cairo_cflags "${_cairo_cflags} ${f}")
endforeach(f)
set(CAIRO_CFLAGS ${_cairo_cflags})

set(_rsvg_def "")
if(HAVE_RSVG)
  set(_rsvg_def "-DHAVE_RSVG=1")
endif(HAVE_RSVG)

set(_pango_def "")
if (SDLPANGO_FOUND)
  set(_pango_def "-DHAVE_LIBSDL_PANGO=1")
endif (SDLPANGO_FOUND)