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")
}
|