File: cairo.prf

package info (click to toggle)
openscad 2021.01-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,096 kB
  • sloc: cpp: 53,199; sh: 4,384; ansic: 4,382; python: 1,813; yacc: 853; javascript: 762; lex: 417; lisp: 163; xml: 127; makefile: 118
file content (48 lines) | stat: -rw-r--r-- 1,038 bytes parent folder | download | duplicates (4)
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
#Cairo Detection
#
# Priority
# 0. CAIRO_INCLUDE_DIR if set
# 1. OPENSCAD_LIBRARIES cairo
# 2. system's standard include paths for cairo (Using pkg-config)
# OPENSCAD_LIBRARIES check is not added yet

isEmpty(CAIRO_INCLUDEPATH){
    CAIRO_INCLUDEPATH = $$(CAIRO_INCLUDE_DIR)
}
isEmpty(CAIRO_LIBPATH){
    CAIRO_LIBPATH = $$(CAIRO_LIBRARIES)
}

exists($$CAIRO_INCLUDEPATH/cairo/cairo.h){
    ENABLE_CAIRO=yes
} else {
    CAIRO_INCLUDEPATH = 
    CAIRO_LIBPATH = 
}

isEmpty(CAIRO_INCLUDEPATH){
  CAIRO_CFLAGS = $$system("$$PKG_CONFIG --cflags cairo")
  !isEmpty(CAIRO_CFLAGS){
      ENABLE_CAIRO=yes
  }
} else {
    CAIRO_CFLAGS = -I$$CAIRO_INCLUDEPATH/cairo
}

isEmpty(CAIRO_LIBPATH){
    CAIRO_LIBS = $$system("$$PKG_CONFIG --libs cairo")
    !isEmpty(CAIRO_LIBS){
        ENABLE_CAIRO=yes
    }
} else {
    CAIRO_LIBS = -L$$CAIRO_LIBPATH -lcairo
}

!isEmpty(ENABLE_CAIRO){
    DEFINES += ENABLE_CAIRO
    QMAKE_CXXFLAGS += $$CAIRO_CFLAGS
    LIBS += $$CAIRO_LIBS
    message("cairo enabled")
} else {
    message("cairo disabled")
}