File: freetype.pri

package info (click to toggle)
openscad 2015.03-2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 30,804 kB
  • ctags: 5,692
  • sloc: cpp: 39,386; sh: 3,856; ansic: 3,674; python: 1,393; yacc: 496; lex: 272; lisp: 159; makefile: 67; xml: 60
file content (38 lines) | stat: -rw-r--r-- 1,046 bytes parent folder | download
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
# Detect freetype2, then use this priority list to determine
# which library to use:
#
# Priority
# 1. FREETYPE_INCLUDEPATH / FREETYPE_LIBPATH (qmake parameter, not checked it given on commandline)
# 2. OPENSCAD_LIBRARIES (environment variable)
# 3. system's standard include paths from pkg-config

freetype {

# read environment variables
OPENSCAD_LIBRARIES_DIR = $$(OPENSCAD_LIBRARIES)
FREETYPE_DIR = $$(FREETYPEDIR)

!isEmpty(OPENSCAD_LIBRARIES_DIR) {
  isEmpty(FREETYPE_INCLUDEPATH) {
    exists($$OPENSCAD_LIBRARIES_DIR/include/freetype2) {
      FREETYPE_INCLUDEPATH = $$OPENSCAD_LIBRARIES_DIR/include/freetype2
      FREETYPE_LIBPATH = $$OPENSCAD_LIBRARIES_DIR/lib
    }
  }
}

isEmpty(FREETYPE_INCLUDEPATH) {
  FREETYPE_CFLAGS = $$system("pkg-config --cflags freetype2")
} else {
  FREETYPE_CFLAGS = -I$$FREETYPE_INCLUDEPATH
}

isEmpty(FREETYPE_LIBPATH) {
  FREETYPE_LIBS = $$system("pkg-config --libs freetype2")
} else {
  FREETYPE_LIBS = -L$$FREETYPE_LIBPATH -lfreetype
}

QMAKE_CXXFLAGS += $$FREETYPE_CFLAGS
LIBS += $$FREETYPE_LIBS
}