Add libraries to qmake config.

text-module
Torsten Paul 2014-01-19 03:05:54 +01:00 committed by Marius Kintel
parent 5741b64036
commit 8bb32da1c4
5 changed files with 109 additions and 2 deletions

View File

@ -13,4 +13,6 @@ include(eigen.pri)
include(boost.pri)
include(glib-2.0.pri)
include(sparkle.pri)
include(harfbuzz.pri)
include(freetype.pri)
include(fontconfig.pri)

36
fontconfig.pri Normal file
View File

@ -0,0 +1,36 @@
# Detect fontconfig, then use this priority list to determine
# which library to use:
#
# Priority
# 1. FONTCONFIG_INCLUDEPATH / FONTCONFIG_LIBPATH (qmake parameter, not checked it given on commandline)
# 2. OPENSCAD_LIBRARIES (environment variable)
# 3. system's standard include paths from pkg-config
fontconfig {
# read environment variables
OPENSCAD_LIBRARIES_DIR = $$(OPENSCAD_LIBRARIES)
FONTCONFIG_DIR = $$(FONTCONFIGDIR)
!isEmpty(OPENSCAD_LIBRARIES_DIR) {
isEmpty(FONTCONFIG_INCLUDEPATH) {
FONTCONFIG_INCLUDEPATH = $$OPENSCAD_LIBRARIES_DIR/include/fontconfig
FONTCONFIG_LIBPATH = $$OPENSCAD_LIBRARIES_DIR/lib
}
}
isEmpty(FONTCONFIG_INCLUDEPATH) {
FONTCONFIG_CFLAGS = $$system("pkg-config --cflags fontconfig")
} else {
FONTCONFIG_CFLAGS = -I$$FONTCONFIG_INCLUDEPATH
}
isEmpty(FONTCONFIG_LIBPATH) {
FONTCONFIG_LIBS = $$system("pkg-config --libs fontconfig")
} else {
FONTCONFIG_LIBS = -L$$FONTCONFIG_LIBPATH -lfontconfig
}
QMAKE_CXXFLAGS += $$FONTCONFIG_CFLAGS
LIBS += $$FONTCONFIG_LIBS
}

View File

@ -1,5 +1,36 @@
# 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 {
QMAKE_CXXFLAGS += `pkg-config --cflags freetype2 harfbuzz fontconfig`
LIBS += `pkg-config --libs freetype2 harfbuzz fontconfig`
# read environment variables
OPENSCAD_LIBRARIES_DIR = $$(OPENSCAD_LIBRARIES)
FREETYPE_DIR = $$(FREETYPEDIR)
!isEmpty(OPENSCAD_LIBRARIES_DIR) {
isEmpty(FREETYPE_INCLUDEPATH) {
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
}

36
harfbuzz.pri Normal file
View File

@ -0,0 +1,36 @@
# Detect harfbuzz, then use this priority list to determine
# which library to use:
#
# Priority
# 1. HARFBUZZ_INCLUDEPATH / HARFBUZZ_LIBPATH (qmake parameter, not checked it given on commandline)
# 2. OPENSCAD_LIBRARIES (environment variable)
# 3. system's standard include paths from pkg-config
harfbuzz {
# read environment variables
OPENSCAD_LIBRARIES_DIR = $$(OPENSCAD_LIBRARIES)
HARFBUZZ_DIR = $$(HARFBUZZDIR)
!isEmpty(OPENSCAD_LIBRARIES_DIR) {
isEmpty(HARFBUZZ_INCLUDEPATH) {
HARFBUZZ_INCLUDEPATH = $$OPENSCAD_LIBRARIES_DIR/include/harfbuzz
HARFBUZZ_LIBPATH = $$OPENSCAD_LIBRARIES_DIR/lib
}
}
isEmpty(HARFBUZZ_INCLUDEPATH) {
HARFBUZZ_CFLAGS = $$system("pkg-config --cflags harfbuzz")
} else {
HARFBUZZ_CFLAGS = -I$$HARFBUZZ_INCLUDEPATH
}
isEmpty(HARFBUZZ_LIBPATH) {
HARFBUZZ_LIBS = $$system("pkg-config --libs harfbuzz")
} else {
HARFBUZZ_LIBS = -L$$HARFBUZZ_LIBPATH -lharfbuzz
}
QMAKE_CXXFLAGS += $$HARFBUZZ_CFLAGS
LIBS += $$HARFBUZZ_LIBS
}

View File

@ -155,7 +155,9 @@ CONFIG += opencsg
CONFIG += boost
CONFIG += eigen
CONFIG += glib-2.0
CONFIG += harfbuzz
CONFIG += freetype
CONFIG += fontconfig
#Uncomment the following line to enable QCodeEdit
#CONFIG += qcodeedit