Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks for Mac compilation. #409

Merged
merged 4 commits into from
Jan 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tools/ld-analyse/dropoutanalysisdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,20 @@
#define DROPOUTANALYSISDIALOG_H

#include <QDialog>
/* Workaround to compile on Mac. Similar may need to be done for other non-ubuntu distros */
#if defined(__APPLE__)
#include <qwt_plot.h>
#include <qwt_plot_canvas.h>
#include <qwt_legend.h>
#include <qwt_plot_grid.h>
#include <qwt_plot_curve.h>
#else
#include <qwt/qwt_plot.h>
#include <qwt/qwt_plot_canvas.h>
#include <qwt/qwt_legend.h>
#include <qwt/qwt_plot_grid.h>
#include <qwt/qwt_plot_curve.h>
#endif

#include "lddecodemetadata.h"

Expand Down
16 changes: 11 additions & 5 deletions tools/ld-analyse/ld-analyse.pro
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,24 @@ RESOURCES += \
ld-analyse-resources.qrc

# Additional include paths to support MacOS compilation
macx {
INCLUDEPATH += "/usr/local/opt/opencv@2/include"
LIBS += -L"/usr/local/opt/opencv@2/lib"
INCLUDEPATH += "/usr/local/include"
}

# Normal open-source OS goodness
INCLUDEPATH += "/usr/local/include/opencv"
LIBS += -L"/usr/local/lib"
LIBS += -lopencv_core -lopencv_imgcodecs -lopencv_highgui -lopencv_imgproc -lopencv_video -lfftw3

# Include the QWT library (used for charting)
unix:!macx {
INCLUDEPATH += $(QWT)/include
LIBS += -lqwt-qt5




LIBS += -lqwt-qt5 #Distrubutions other than Ubuntu may be -lqwt
}
macx {
# There's probably a better way to reference these, but works for now...
INCLUDEPATH += "/usr/local/Cellar/qwt/6.1.4/lib/qwt.framework/Versions/6/Headers"
LIBS += -F"/usr/local/Cellar/qwt/6.1.4/lib" -framework qwt
}
4 changes: 4 additions & 0 deletions tools/ld-analyse/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ void MainWindow::showFrame()
if (!tbcSource.getIsSourcePal()) {
closedCaptionDialog->addData(currentFrameNumber, tbcSource.getCcData0(currentFrameNumber), tbcSource.getCcData1(currentFrameNumber));
}
// QT Bug workaround for some macOS versions
#if defined(Q_OS_MACOS)
repaint();
#endif
}

// Redraw the frame viewer (for example, when scaleFactor has been changed)
Expand Down
14 changes: 14 additions & 0 deletions tools/ld-analyse/snranalysisdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,26 @@
#ifndef SNRANALYSISDIALOG_H
#define SNRANALYSISDIALOG_H

/* workaround for Macs */
#if defined(__APPLE__)
#define isnanf(X) isnan((double)(X))
#endif

#include <QDialog>
/* Workaround to compile on Mac. Similar may need to be done for other non-ubuntu distros */
#if defined(__APPLE__)
#include <qwt_plot.h>
#include <qwt_plot_canvas.h>
#include <qwt_legend.h>
#include <qwt_plot_grid.h>
#include <qwt_plot_curve.h>
#else
#include <qwt/qwt_plot.h>
#include <qwt/qwt_plot_canvas.h>
#include <qwt/qwt_legend.h>
#include <qwt/qwt_plot_grid.h>
#include <qwt/qwt_plot_curve.h>
#endif

#include "lddecodemetadata.h"

Expand Down
3 changes: 3 additions & 0 deletions tools/ld-chroma-decoder/ld-chroma-decoder.pro
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ unix:!android: target.path = $$PREFIX/bin/
!isEmpty(target.path): INSTALLS += target

# Additional include paths to support MacOS compilation
macx {
INCLUDEPATH += "/usr/local/opt/opencv@2/include"
LIBS += -L"/usr/local/opt/opencv@2/lib"
INCLUDEPATH += "/usr/local/include"
}

# Normal open-source OS goodness
INCLUDEPATH += "/usr/local/include/opencv"
Expand Down