Enable PDF antialiasing
[pykit.git] / pykit.pro
index 63d9604..ea387ff 100644 (file)
--- a/pykit.pro
+++ b/pykit.pro
@@ -1,29 +1,61 @@
+# CONFIG += no_poppler
+CONFIG += console
 TEMPLATE = app
 TARGET = pykit
 DEPENDPATH += .
 INCLUDEPATH += .
 QT += webkit network gui core
 
+isEmpty(PYTHON) {
+    PYTHON = python
+}
+isEmpty(PYTHONCONFIG) {
+    PYTHONCONFIG = $${PYTHON}-config
+}
+
+isEmpty(LIBBOOSTPYTHON) {
+    LIBBOOSTPYTHON = boost_python
+}
+
 # boost_python
-LIBS += -lboost_python
+LIBS += -l$${LIBBOOSTPYTHON}
 
 # python
-QMAKE_CXXFLAGS += $$system(python-config --cflags)
-QMAKE_CFFLAGS += $$system(python-config --cflags)
-LIBS += $$system(python-config --ldflags)
+isEmpty(LIBPYTHON) {
+    QMAKE_CXXFLAGS += $$system($$PYTHONCONFIG --cflags)
+    QMAKE_CXXFLAGS -= -Wstrict-prototypes
+    LIBS += $$system($$PYTHONCONFIG --ldflags)
+}
+else {
+    LIBS += -l$$LIBPYTHON
+}
 
-# poppler
-LIBS += -lpoppler-qt4 -lpoppler
+mac {
+    # Qt is not available as univeral library and provides
+    # a correct -arch tag automatically
+    QMAKE_CXXFLAGS -= -arch ppc x86_64 i386
+    QMAKE_CFLAGS -= -arch ppc x86_64 i386
+}
+
+win32 {
+    QMAKE_CXXFLAGS += -fno-strict-aliasing
+}
 
 # Input
 HEADERS += MainWindow.hh \
            Publisher.hh \
            PythonPublisher.hh \
-           Viewer.hh \
-           PDFWidget.hh
+           Viewer.hh
 SOURCES += main.cc \
            MainWindow.cc \
            Publisher.cc \
            PythonPublisher.cc \
-           Viewer.cc \
-           PDFWidget.cc
+           Viewer.cc
+
+# poppler
+!no_poppler {
+    LIBS += -lpoppler-qt4 -lpoppler
+    HEADERS += PDFWidget.hh
+    SOURCES += PDFWidget.cc
+    DEFINES += POPPLER
+}