From cfb88e68632338943cecbc7d2b5366413f5daf19 Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Thu, 3 Apr 2014 23:30:51 -0400 Subject: [PATCH 1/3] Fixes for when we don't have liblo on mac os x --- OscInterface.cpp | 2 ++ OscInterface.h | 2 ++ OscReceiver.cpp | 3 +++ OscReceiver.h | 2 ++ mapmap.pro | 3 ++- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/OscInterface.cpp b/OscInterface.cpp index db66cd1..131323f 100644 --- a/OscInterface.cpp +++ b/OscInterface.cpp @@ -20,6 +20,7 @@ * along with this program. If not, see . */ +#ifdef HAVE_OSC #include "OscInterface.h" #include "MainWindow.h" #include "unused.h" @@ -230,3 +231,4 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma // open(); } +#endif // HAVE_OSC diff --git a/OscInterface.h b/OscInterface.h index 27e5af3..6aa0a7a 100644 --- a/OscInterface.h +++ b/OscInterface.h @@ -22,6 +22,7 @@ #ifndef OSC_INTERFACE_H_ #define OSC_INTERFACE_H_ +#ifdef HAVE_OSC #include #include "concurrentqueue.h" @@ -76,4 +77,5 @@ class OscInterface }; +#endif // HAVE_OSC #endif /* include guard */ diff --git a/OscReceiver.cpp b/OscReceiver.cpp index a739d91..c9b1f3d 100644 --- a/OscReceiver.cpp +++ b/OscReceiver.cpp @@ -1,3 +1,4 @@ +#ifdef HAVE_OSC #include "OscReceiver.h" #include #include @@ -85,3 +86,5 @@ std::string OscReceiver::toString() const return "port:" + port_; } +#endif // HAVE_OSC + diff --git a/OscReceiver.h b/OscReceiver.h index cf1b7f9..d615940 100644 --- a/OscReceiver.h +++ b/OscReceiver.h @@ -1,5 +1,6 @@ #ifndef _OSC_RECEIVER_H_ #define _OSC_RECEIVER_H_ +#ifdef HAVE_OSC #include "lo/lo.h" #include @@ -29,5 +30,6 @@ class OscReceiver { static void error(int num, const char *msg, const char *path); }; +#endif // HAVE_OSC #endif // _OSC_RECEIVER_H_ diff --git a/mapmap.pro b/mapmap.pro index d7381d9..7116df4 100644 --- a/mapmap.pro +++ b/mapmap.pro @@ -75,9 +75,10 @@ mac { INCLUDEPATH += \ /opt/local/include/ \ /opt/local/include/libxml2 - LIBS += -L/opt/local/lib \ + LIBS += \ -framework OpenGL \ -framework GLUT + # -L/opt/local/lib \ QMAKE_CXXFLAGS += -D__MACOSX_CORE__ QMAKE_CXXFLAGS += -stdlib=libstdc++ From 74efb0dada8f5d7f21b4c5a9630b6f4f56bb132a Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Fri, 4 Apr 2014 00:29:41 -0400 Subject: [PATCH 2/3] fix crash on Mac OS X --- DestinationGLCanvas.cpp | 6 +++++- MainWindow.cpp | 3 ++- main.cpp | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DestinationGLCanvas.cpp b/DestinationGLCanvas.cpp index a63750c..ee771a5 100644 --- a/DestinationGLCanvas.cpp +++ b/DestinationGLCanvas.cpp @@ -61,8 +61,12 @@ void DestinationGLCanvas::doDraw(QPainter* painter) // } // } - glPushMatrix(); + MainWindow &mainwindow = MainWindow::getInstance(); + if ((&mainwindow) == NULL) + return; + + glPushMatrix(); MappingManager& mappingManager = MainWindow::getInstance().getMappingManager(); QVector mappings = mappingManager.getVisibleMappings(); for (QVector::const_iterator it = mappings.begin(); it != mappings.end(); ++it) diff --git a/MainWindow.cpp b/MainWindow.cpp index 98b6a39..7694ac9 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -28,6 +28,7 @@ MainWindow* MainWindow::instance = 0; MainWindow::MainWindow() { + MainWindow::setInstance(this); // Create model. mappingManager = new MappingManager; @@ -60,7 +61,7 @@ MainWindow::MainWindow() MainWindow& MainWindow::getInstance() { - Q_ASSERT(instance); + //Q_ASSERT(instance); return *instance; } diff --git a/main.cpp b/main.cpp index 55983ad..28e7acc 100644 --- a/main.cpp +++ b/main.cpp @@ -23,7 +23,6 @@ int main(int argc, char *argv[]) app.installTranslator(&translator); MainWindow win; - MainWindow::setInstance(&win); //win.setLocale(QLocale("fr")); From 069e5a5e6f0f32eab4909a394e14e2d8a85f611f Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Fri, 4 Apr 2014 00:36:35 -0400 Subject: [PATCH 3/3] update INSTALL with infos for Mac OS X --- INSTALL | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/INSTALL b/INSTALL index 7c34084..25e8b44 100644 --- a/INSTALL +++ b/INSTALL @@ -2,11 +2,15 @@ Build instructions ================== This file is written in rst, so that one can use rst2pdf to create a PDF out of it. + +Build on GNU/Linux +------------------ Dependencies: * Qt * qt4-default * qt4-qmake + * liblo Build it:: @@ -18,6 +22,7 @@ Do this:: sudo apt-get install -y \ qt4-default \ + liblo-dev \ qt4-qmake For extras:: @@ -35,3 +40,14 @@ Then, do this:: linguist mapmap_fr.ts +Build on Mac OS X +----------------- + +* Install the Apple Developer Tools. You need to register with a credit card in the Apple Store in order to download it. +* Install Qt5. You can get it from http://qt-project.org/downloads and choose the default location. + +Do this:: + + ~/Qt5.2.1/5.2.1/clang_64/bin/qmake + make +