openscad/freetype.pri

39 lines
1.0 KiB
Plaintext
Raw Normal View History

2014-01-19 06:05:54 +04:00
# 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
2014-01-19 06:05:00 +04:00
freetype {
2014-01-19 06:05:54 +04:00
# 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
}
2014-01-19 06:05:54 +04:00
}
}
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
2014-01-19 06:05:00 +04:00
}
2014-01-19 06:05:54 +04:00
QMAKE_CXXFLAGS += $$FREETYPE_CFLAGS
LIBS += $$FREETYPE_LIBS
}