From 84dbbfe841d7293b2e5f15fb70dc334590abd4c1 Mon Sep 17 00:00:00 2001
From: Mark Watkins <jedimark@users.sourceforge.net>
Date: Mon, 4 Nov 2013 12:45:33 +1000
Subject: [PATCH] Clean up 3rdparty bundling.. Mac & Windows use static
 qextserialport and quazip

---
 SleepyHeadQT.pro          |  3 ---
 sleepyhead/oximetry.cpp   |  5 -----
 sleepyhead/oximetry.h     |  5 -----
 sleepyhead/sleepyhead.pro | 41 ++++++++-------------------------------
 4 files changed, 8 insertions(+), 46 deletions(-)

diff --git a/SleepyHeadQT.pro b/SleepyHeadQT.pro
index 0e44c417..ce1fd44f 100644
--- a/SleepyHeadQT.pro
+++ b/SleepyHeadQT.pro
@@ -1,11 +1,8 @@
 TEMPLATE = subdirs
 
-win32:SUBDIRS = 3rdparty
-
 SUBDIRS += sleepyhead
 
 CONFIG += ordered
-win32:sleepyhead.depends = 3rdparty
 
 TRANSLATIONS += \
     Translations/Nederlands.nl_NL.ts \
diff --git a/sleepyhead/oximetry.cpp b/sleepyhead/oximetry.cpp
index fd2d5371..7cb88c4a 100644
--- a/sleepyhead/oximetry.cpp
+++ b/sleepyhead/oximetry.cpp
@@ -9,12 +9,7 @@
 #include <QCalendarWidget>
 #include <QTextCharFormat>
 
-
-#ifdef USE_BUNDLED_LIBS
-#include "src/qextserialenumerator.h"
-#else
 #include <qextserialenumerator.h>
-#endif
 
 #include "oximetry.h"
 #include "ui_oximetry.h"
diff --git a/sleepyhead/oximetry.h b/sleepyhead/oximetry.h
index d2d40b1b..4ac2e765 100644
--- a/sleepyhead/oximetry.h
+++ b/sleepyhead/oximetry.h
@@ -14,12 +14,7 @@
 #include <QMessageBox>
 #include <QMutex>
 
-#ifdef USE_BUNDLED_LIBS
-#include "src/qextserialport.h"
-#else
-
 #include <qextserialport.h>
-#endif
 
 #include "SleepLib/profiles.h"
 #include "SleepLib/day.h"
diff --git a/sleepyhead/sleepyhead.pro b/sleepyhead/sleepyhead.pro
index b32e7c83..990912a0 100644
--- a/sleepyhead/sleepyhead.pro
+++ b/sleepyhead/sleepyhead.pro
@@ -14,10 +14,6 @@ greaterThan(QT_MAJOR_VERSION,4) {
 
 CONFIG += rtti
 
-win32:CONFIG += use_bundled_libs
-
-use_bundled_libs:DEFINES += USE_BUNDLED_LIBS
-
 #static {
 #    CONFIG += static
 #    QTPLUGIN += qsvg qgif qpng
@@ -39,7 +35,7 @@ exists(../.git):{
 
     GIT_BRANCH=$$system(git rev-parse --abbrev-ref HEAD)
     DEFINES += GIT_BRANCH=\\\"$$GIT_BRANCH\\\"
-    DEFINES += GIT_REVISION=\\\"$$system(git rev-parse HEAD)\\\"
+    DEFINES += GIT_REVISION=\\\"$$system(git rev-parse --short HEAD)\\\"
 
     contains(GIT_BRANCH,"unstable"):DEFINES += UNSTABLE_BUILD
 
@@ -228,42 +224,21 @@ mac {
     QMAKE_BUNDLE_DATA += TransFiles
 }
 
-win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../3rdparty/quazip/quazip/release/ -lquazip
-else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../3rdparty/quazip/quazip/debug/ -lquazip
-else:mac {
+win32|mac {
     include(../3rdparty/quazip/quazip/quazip.pri)
     INCLUDEPATH += $$PWD/../3rdparty/quazip
-} else:unix {
-    use_bundled_libs:QMAKE_LFLAGS += -L$$OUT_PWD/../3rdparty/quazip/
-    else:QMAKE_LFLAGS += -L/usr/lib -L/usr/local/lib
-
-    LIBS += -lquazip
-}
-
-use_bundled_libs {
-    INCLUDEPATH += $$PWD/../3rdparty/quazip
     DEPENDPATH += $$PWD/../3rdparty/quazip
-} else {
+} else:unix {
+    QMAKE_LFLAGS += -L/usr/lib -L/usr/local/lib
     INCLUDEPATH += /usr/local/include
     INCLUDEPATH += /usr/include
     DEPENDPATH += /usr/local/include/quazip
     DEPENDPATH += /usr/include/quazip
+    LIBS += -lquazip
 }
 
-use_bundled_libs: {
-    greaterThan(QT_MAJOR_VERSION,4) {
-        win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../3rdparty/qextserialport/release/ -lQt5ExtSerialPort1
-        else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../3rdparty/qextserialport/debug/ -lQt5ExtSerialPortd1
-        else:unix:CONFIG(release, debug|release): LIBS += -lQtExtSerialPort
-        else:unix:CONFIG(debug, debug|release): LIBS += -lQtExtSerialPortd
-    } else {
-        win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../3rdparty/qextserialport/release/ -lqextserialport
-        else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../3rdparty/qextserialport/debug/ -lqextserialport
-        else:unix: LIBS += -lqextserialport
-    }
-    INCLUDEPATH += $$PWD/../3rdparty/qextserialport
-    DEPENDPATH += $$PWD/../3rdparty/qextserialport
+win32|mac{
+    include(../3rdparty/qextserialport/src/qextserialport.pri)
 } else {
-    mac:include(../3rdparty/qextserialport/src/qextserialport.pri)
-    else:CONFIG += extserialport
+    CONFIG += extserialport
 }