typo fix
[pykit.git] / pykit.pro
index 63d9604..e204b7c 100644 (file)
--- a/pykit.pro
+++ b/pykit.pro
@@ -1,29 +1,72 @@
+# CONFIG += no_poppler
+# CONFIG += no_webkit
+# CONFIG += console
+CONFIG += windows
 TEMPLATE = app
 TARGET = pykit
 DEPENDPATH += .
 INCLUDEPATH += .
-QT += webkit network gui core
+QT += network gui core svg
+
+# Used to manually link against latest webkit
+!no_webkit {
+    QT += webkit
+}
+
+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)
+    # OUCH ... on Mac we sometimes have multiple python versions (in this case MacPorts and native)
+    # We need to explicitly specify the path as to link against the correct Version
+    LIBS -= $$system($$PYTHONCONFIG --libs | sed -e "'s/.*\\\\(-lpython[0-9.]*\\\\\).*/\\\\1/'")
+    LIBS += $$system(ls `$$PYTHONCONFIG --ldflags | sed -e "'s/.*-L\\\\([^ ]*\\\\).*/\\\\1/'"`/lib`$$PYTHONCONFIG --libs  | sed -e "'s/.*-l\\\\(python[0-9.]*\\\\).*/\\\\1/'"`* | tail -1)
+}
+else {
+    LIBS += -l$$LIBPYTHON
+}
 
-# poppler
-LIBS += -lpoppler-qt4 -lpoppler
+mac {
+    QMAKE_CXXFLAGS += -mmacosx-version-min=10.4
+    QMAKE_CXXFLAGS -= -arch ppc x86_64 i386
+}
+
+win32 {
+    QMAKE_CXXFLAGS += -fno-strict-aliasing
+}
 
 # Input
 HEADERS += MainWindow.hh \
            Publisher.hh \
            PythonPublisher.hh \
-           Viewer.hh \
-           PDFWidget.hh
+           PythonHTTP.hh \
+           Viewer.hh
 SOURCES += main.cc \
            MainWindow.cc \
            Publisher.cc \
            PythonPublisher.cc \
-           Viewer.cc \
-           PDFWidget.cc
+           PythonHTTP.cc \
+           Viewer.cc
+
+# poppler
+!no_poppler {
+    LIBS += -lpoppler-qt4 -lpoppler
+    HEADERS += PDFWidget.hh
+    SOURCES += PDFWidget.cc
+    DEFINES += POPPLER
+}