mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Merge remote-tracking branch 'origin/patrickh/OP-1103_Fixes_for_OSX_after_Qt511_update' into next
This commit is contained in:
commit
fa2b6c30ef
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,6 +25,7 @@ GTAGS
|
|||||||
openpilotgcs-build-desktop
|
openpilotgcs-build-desktop
|
||||||
|
|
||||||
# Ignore some of the .pro.user files
|
# Ignore some of the .pro.user files
|
||||||
|
*.pro.user
|
||||||
/ground/openpilotgcs/openpilotgcs.pro.user
|
/ground/openpilotgcs/openpilotgcs.pro.user
|
||||||
/ground/uavobjgenerator/uavobjgenerator.pro.user
|
/ground/uavobjgenerator/uavobjgenerator.pro.user
|
||||||
/ground/uavobjects/uavobjects.pro.user
|
/ground/uavobjects/uavobjects.pro.user
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
# qt-creator users. Top level Makefile handles all dependencies itself
|
# qt-creator users. Top level Makefile handles all dependencies itself
|
||||||
# and does not use ground.pro.
|
# and does not use ground.pro.
|
||||||
|
|
||||||
|
cache()
|
||||||
|
|
||||||
message("Make sure you have shadow build path set as noted in ground.pro. Build will fail otherwise")
|
message("Make sure you have shadow build path set as noted in ground.pro. Build will fail otherwise")
|
||||||
|
|
||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
@ -3,10 +3,24 @@
|
|||||||
# Copyright (c) 2009-2013, The OpenPilot Team, http://www.openpilot.org
|
# Copyright (c) 2009-2013, The OpenPilot Team, http://www.openpilot.org
|
||||||
#
|
#
|
||||||
|
|
||||||
#version check qt
|
cache()
|
||||||
contains(QT_VERSION, ^4\\.[0-7]\\..*) {
|
|
||||||
message("Cannot build OpenPilot GCS with Qt version $${QT_VERSION}.")
|
#check Qt version
|
||||||
error("Cannot build OpenPilot GCS with Qt version $${QT_VERSION}. Use at least Qt 4.8!")
|
QT_VERSION = $$[QT_VERSION]
|
||||||
|
QT_VERSION = $$split(QT_VERSION, ".")
|
||||||
|
QT_VER_MAJ = $$member(QT_VERSION, 0)
|
||||||
|
QT_VER_MIN = $$member(QT_VERSION, 1)
|
||||||
|
|
||||||
|
lessThan(QT_VER_MAJ, 5) | lessThan(QT_VER_MIN, 1) {
|
||||||
|
error(OpenPilot GCS requires Qt 5.1.0 or newer but Qt $$[QT_VERSION] was detected.)
|
||||||
|
}
|
||||||
|
|
||||||
|
macx {
|
||||||
|
# This ensures that code is compiled with the /usr/bin version of gcc instead
|
||||||
|
# of the gcc in XCode.app/Context/Development
|
||||||
|
QMAKE_CC = /usr/bin/gcc
|
||||||
|
QMAKE_CXX = /usr/bin/g++
|
||||||
|
QMAKE_LINK = /usr/bin/g++
|
||||||
}
|
}
|
||||||
|
|
||||||
include(openpilotgcs.pri)
|
include(openpilotgcs.pri)
|
||||||
|
@ -12,8 +12,11 @@ defineReplace(prependAll) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
XMLPATTERNS = $$targetPath($$[QT_INSTALL_BINS]/xmlpatterns)
|
XMLPATTERNS = $$targetPath($$[QT_INSTALL_BINS]/xmlpatterns)
|
||||||
LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines -no-sort -noobsolete
|
LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines -no-sort
|
||||||
LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease)
|
LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease)
|
||||||
|
LCONVERT = $$targetPath($$[QT_INSTALL_BINS]/lconvert)
|
||||||
|
|
||||||
|
wd = $$replace(GCS_SOURCE_TREE, /, $$QMAKE_DIR_SEP)
|
||||||
|
|
||||||
TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/openpilotgcs_,.ts)
|
TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/openpilotgcs_,.ts)
|
||||||
|
|
||||||
@ -34,7 +37,7 @@ QMAKE_EXTRA_TARGETS += ts
|
|||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
TARGET = phony_target2
|
TARGET = phony_target2
|
||||||
CONFIG -= qt
|
CONFIG -= qt sdk separate_debug_info gdb_dwarf_index
|
||||||
QT =
|
QT =
|
||||||
LIBS =
|
LIBS =
|
||||||
|
|
||||||
|
@ -21,6 +21,16 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = sdlgamepad
|
TARGET = sdlgamepad
|
||||||
DEFINES += SDLGAMEPAD_LIBRARY
|
DEFINES += SDLGAMEPAD_LIBRARY
|
||||||
|
macx {
|
||||||
|
# Workaround to ensure that SDL framework and associated header files are found
|
||||||
|
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
|
||||||
|
SDL = -F/Library/Frameworks
|
||||||
|
# Add SDL to CFLAGS fixes build problems on mac
|
||||||
|
QMAKE_CFLAGS += $$SDL
|
||||||
|
QMAKE_CXXFLAGS += $$SDL
|
||||||
|
# Let the linker know where to find the frameworks
|
||||||
|
LIBS += $$SDL
|
||||||
|
}
|
||||||
|
|
||||||
include(../../openpilotgcslibrary.pri)
|
include(../../openpilotgcslibrary.pri)
|
||||||
|
|
||||||
@ -28,7 +38,7 @@ SOURCES += sdlgamepad.cpp
|
|||||||
HEADERS += sdlgamepad.h \
|
HEADERS += sdlgamepad.h \
|
||||||
sdlgamepad_global.h
|
sdlgamepad_global.h
|
||||||
|
|
||||||
macx:LIBS += -framework SDL
|
macx:LIBS += -framework OpenGL -framework SDL -framework Cocoa
|
||||||
!macx:LIBS += -lSDL
|
!macx:LIBS += -lSDL
|
||||||
|
|
||||||
OTHER_FILES += COPYING \
|
OTHER_FILES += COPYING \
|
||||||
|
@ -20,7 +20,6 @@ HEADERS += configplugin.h \
|
|||||||
configpipxtremewidget.h \
|
configpipxtremewidget.h \
|
||||||
configstabilizationwidget.h \
|
configstabilizationwidget.h \
|
||||||
assertions.h \
|
assertions.h \
|
||||||
calibration.h \
|
|
||||||
defaultattitudewidget.h \
|
defaultattitudewidget.h \
|
||||||
defaulthwsettingswidget.h \
|
defaulthwsettingswidget.h \
|
||||||
inputchannelform.h \
|
inputchannelform.h \
|
||||||
@ -51,10 +50,7 @@ SOURCES += configplugin.cpp \
|
|||||||
configccattitudewidget.cpp \
|
configccattitudewidget.cpp \
|
||||||
configstabilizationwidget.cpp \
|
configstabilizationwidget.cpp \
|
||||||
configpipxtremewidget.cpp \
|
configpipxtremewidget.cpp \
|
||||||
twostep.cpp \
|
|
||||||
legacy-calibration.cpp \
|
legacy-calibration.cpp \
|
||||||
gyro-calibration.cpp \
|
|
||||||
alignment-calibration.cpp \
|
|
||||||
defaultattitudewidget.cpp \
|
defaultattitudewidget.cpp \
|
||||||
defaulthwsettingswidget.cpp \
|
defaulthwsettingswidget.cpp \
|
||||||
inputchannelform.cpp \
|
inputchannelform.cpp \
|
||||||
|
@ -171,9 +171,6 @@ MainWindow::MainWindow() :
|
|||||||
m_modeStack->setMovable(false);
|
m_modeStack->setMovable(false);
|
||||||
m_modeStack->setMinimumWidth(512);
|
m_modeStack->setMinimumWidth(512);
|
||||||
m_modeStack->setElideMode(Qt::ElideRight);
|
m_modeStack->setElideMode(Qt::ElideRight);
|
||||||
#ifndef Q_WS_MAC
|
|
||||||
m_modeStack->setDocumentMode(true);
|
|
||||||
#endif
|
|
||||||
m_modeManager = new ModeManager(this, m_modeStack);
|
m_modeManager = new ModeManager(this, m_modeStack);
|
||||||
|
|
||||||
m_connectionManager = new ConnectionManager(this);
|
m_connectionManager = new ConnectionManager(this);
|
||||||
|
@ -9,6 +9,18 @@ include(../../plugins/coreplugin/coreplugin.pri)
|
|||||||
include(../../plugins/uavobjects/uavobjects.pri)
|
include(../../plugins/uavobjects/uavobjects.pri)
|
||||||
include(../../libs/sdlgamepad/sdlgamepad.pri)
|
include(../../libs/sdlgamepad/sdlgamepad.pri)
|
||||||
|
|
||||||
|
macx {
|
||||||
|
# Ensures that SDL framework and header files are found when compiled with Qt5.1.1
|
||||||
|
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
|
||||||
|
SDL = -F/Library/Frameworks
|
||||||
|
# Add SDL to CFLAGS fixes build problems on mac
|
||||||
|
QMAKE_CFLAGS += $$SDL
|
||||||
|
QMAKE_CXXFLAGS += $$SDL
|
||||||
|
# Let the linker know where to find the frameworks
|
||||||
|
LIBS += $$SDL
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HEADERS += gcscontrolgadget.h \
|
HEADERS += gcscontrolgadget.h \
|
||||||
gcscontrolgadgetconfiguration.h \
|
gcscontrolgadgetconfiguration.h \
|
||||||
gcscontrolgadgetoptionspage.h
|
gcscontrolgadgetoptionspage.h
|
||||||
|
@ -4,6 +4,7 @@ include(../../openpilotgcsplugin.pri)
|
|||||||
include(../../plugins/coreplugin/coreplugin.pri)
|
include(../../plugins/coreplugin/coreplugin.pri)
|
||||||
include(../../libs/glc_lib/glc_lib.pri)
|
include(../../libs/glc_lib/glc_lib.pri)
|
||||||
include(modelview_dependencies.pri)
|
include(modelview_dependencies.pri)
|
||||||
|
|
||||||
INCLUDEPATH += ../../libs/glc_lib
|
INCLUDEPATH += ../../libs/glc_lib
|
||||||
HEADERS += modelviewplugin.h \
|
HEADERS += modelviewplugin.h \
|
||||||
modelviewgadgetconfiguration.h \
|
modelviewgadgetconfiguration.h \
|
||||||
|
@ -25,7 +25,9 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "QtDebug"
|
#include "QtDebug"
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include "OpenGL/OpenGL.h"
|
||||||
|
#endif
|
||||||
#include "modelviewgadgetwidget.h"
|
#include "modelviewgadgetwidget.h"
|
||||||
#include "extensionsystem/pluginmanager.h"
|
#include "extensionsystem/pluginmanager.h"
|
||||||
#include "glc_context.h"
|
#include "glc_context.h"
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#define OPHID_CONST_H
|
#define OPHID_CONST_H
|
||||||
#include "QtDebug"
|
#include "QtDebug"
|
||||||
|
|
||||||
#define printf qDebug
|
|
||||||
#define OPHID_DEBUG_ON 1
|
#define OPHID_DEBUG_ON 1
|
||||||
#ifdef OPHID_DEBUG_ON
|
#ifdef OPHID_DEBUG_ON
|
||||||
#define OPHID_DEBUG(fmt, args ...) qDebug("[DEBUG] "fmt,##args)
|
#define OPHID_DEBUG(fmt, args ...) qDebug("[DEBUG] "fmt,##args)
|
||||||
|
@ -34,14 +34,8 @@ win32 {
|
|||||||
macx {
|
macx {
|
||||||
SOURCES += src/ophid_usbmon_mac.cpp \
|
SOURCES += src/ophid_usbmon_mac.cpp \
|
||||||
hidapi/mac/hid.c
|
hidapi/mac/hid.c
|
||||||
SDK = /Developer/SDKs/MacOSX10.5.sdk
|
LIBS += -framework CoreFoundation \
|
||||||
ARCH = -mmacosx-version-min=10.5 \
|
-framework IOKit
|
||||||
-arch ppc \
|
|
||||||
-arch i386
|
|
||||||
LIBS += $(ARCH) \
|
|
||||||
-Wl,-syslibroot,$(SDK) \
|
|
||||||
-framework IOKit \
|
|
||||||
-framework CoreFoundation
|
|
||||||
}
|
}
|
||||||
|
|
||||||
linux-g++ {
|
linux-g++ {
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
APP="${1?}"
|
APP="${1?}"
|
||||||
PLUGINS="${APP}/Contents/Plugins"
|
PLUGINS="${APP}/Contents/Plugins"
|
||||||
OP_PLUGINS="${APP}/Contents/Plugins/OpenPilot"
|
OP_PLUGINS="${APP}/Contents/Plugins/OpenPilot"
|
||||||
QT_LIBS="QtDeclarative QtXmlPatterns QtGui QtTest QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtDBus QtScript phonon"
|
QT_LIBS="QtDeclarative QtXmlPatterns QtGui QtTest QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtScript"
|
||||||
QT_DIR=$(otool -L "${APP}/Contents/MacOS/OpenPilot GCS" | sed -n -e 's/\/QtCore\.framework.*//p' | sed -n -E 's:^.::p')
|
QT_DIR=$(otool -L "${APP}/Contents/MacOS/OpenPilot GCS" | sed -n -e 's/\/QtCore\.framework.*//p' | sed -n -E 's:^.::p')
|
||||||
QT_EXTRA="accessible/libqtaccessiblewidgets.dylib bearer/libqgenericbearer.dylib codecs/libqcncodecs.dylib codecs/libqjpcodecs.dylib codecs/libqkrcodecs.dylib codecs/libqtwcodecs.dylib graphicssystems/libqtracegraphicssystem.dylib imageformats/libqgif.dylib imageformats/libqico.dylib imageformats/libqjpeg.dylib imageformats/libqmng.dylib imageformats/libqtiff.dylib imageformats/libqsvg.dylib qmltooling/libqmldbg_inspector.dylib qmltooling/libqmldbg_tcp.dylib graphicssystems/libqglgraphicssystem.dylib sqldrivers/libqsqlodbc.dylib sqldrivers/libqsqlpsql.dylib sqldrivers/libqsqlite.dylib imageformats/libqtga.dylib iconengines/libqsvgicon.dylib"
|
QT_EXTRA="accessible/libqtaccessiblewidgets.dylib bearer/libqgenericbearer.dylib imageformats/libqgif.dylib imageformats/libqico.dylib imageformats/libqjpeg.dylib imageformats/libqmng.dylib imageformats/libqtiff.dylib imageformats/libqsvg.dylib qmltooling/libqmldbg_tcp.dylib sqldrivers/libqsqlodbc.dylib sqldrivers/libqsqlpsql.dylib sqldrivers/libqsqlite.dylib imageformats/libqtga.dylib iconengines/libqsvgicon.dylib"
|
||||||
|
|
||||||
OSG_EXTRA="libosgViewer.90.dylib"
|
OSG_EXTRA="libosgViewer.90.dylib"
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ fi
|
|||||||
echo "Qt library directory is \"${QT_DIR}\""
|
echo "Qt library directory is \"${QT_DIR}\""
|
||||||
|
|
||||||
echo "Running macdeployqt"
|
echo "Running macdeployqt"
|
||||||
macdeployqt "${APP}"
|
macdeployqt "${APP}" -no-strip
|
||||||
|
|
||||||
echo "Processing Qt libraries in ${APP}"
|
echo "Processing Qt libraries in ${APP}"
|
||||||
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib
|
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib
|
||||||
@ -33,57 +33,12 @@ do
|
|||||||
[ ! -L "${f}" ] && for g in $QT_LIBS
|
[ ! -L "${f}" ] && for g in $QT_LIBS
|
||||||
do
|
do
|
||||||
install_name_tool -change \
|
install_name_tool -change \
|
||||||
"${QT_DIR}${g}.framework/Versions/4/${g}" \
|
"${QT_DIR}${g}.framework/Versions/5/${g}" \
|
||||||
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
@executable_path/../Frameworks/${g}.framework/Versions/5/${g} \
|
||||||
"${f}"
|
"${f}"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Copying other libraries that were missed"
|
|
||||||
# should be redundant but some libs missed by main app and macdeployqt
|
|
||||||
for f in ${QT_LIBS}
|
|
||||||
do
|
|
||||||
echo "Copying ${f}"
|
|
||||||
cp -a "${QT_FRAMEWORKS}/${f}.framework" "${APP}/Contents/Frameworks/"
|
|
||||||
|
|
||||||
echo "Changing package identification of ${f}"
|
|
||||||
install_name_tool -id \
|
|
||||||
@executable_path/../Frameworks/${f}.framework/Versions/4/${f} \
|
|
||||||
"${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}"
|
|
||||||
|
|
||||||
rm "${APP}/Contents/Frameworks/${f}.framework/${f}"
|
|
||||||
|
|
||||||
echo "Changing package linkages"
|
|
||||||
for g in $QT_LIBS
|
|
||||||
do
|
|
||||||
install_name_tool -change \
|
|
||||||
"${QT_DIR}${g}.framework/Versions/4/${g}" \
|
|
||||||
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
|
||||||
"${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
for f in ${QT_EXTRA}
|
|
||||||
do
|
|
||||||
echo "Copying package ${f}"
|
|
||||||
d=$(dirname ${f})
|
|
||||||
[ ! -d "${APP}/Contents/Plugins/${d}" ] && mkdir "${APP}/Contents/Plugins/${d}"
|
|
||||||
cp "${QT_PLUGINS}/${f}" "${APP}/Contents/Plugins/${f}"
|
|
||||||
echo "Changing package identification of ${f}"
|
|
||||||
install_name_tool -id \
|
|
||||||
@executable_path/../Plugins/${f} \
|
|
||||||
"${PLUGINS}/${f}"
|
|
||||||
|
|
||||||
echo "Changing package linkages"
|
|
||||||
for g in $QT_LIBS
|
|
||||||
do
|
|
||||||
install_name_tool -change \
|
|
||||||
"${QT_DIR}${g}.framework/Versions/4/${g}" \
|
|
||||||
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
|
||||||
"${APP}/Contents/Plugins/${f}"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Copying SDL"
|
echo "Copying SDL"
|
||||||
cp -a "/Library/Frameworks/SDL.framework" "${APP}/Contents/Frameworks/"
|
cp -a "/Library/Frameworks/SDL.framework" "${APP}/Contents/Frameworks/"
|
||||||
|
|
||||||
@ -96,19 +51,6 @@ install_name_tool -change \
|
|||||||
"@executable_path/../Frameworks/SDL.framework/SDL" \
|
"@executable_path/../Frameworks/SDL.framework/SDL" \
|
||||||
"${APP}/Contents/Plugins/libsdlgamepad.1.dylib"
|
"${APP}/Contents/Plugins/libsdlgamepad.1.dylib"
|
||||||
|
|
||||||
# echo "Copying OSG libraries"
|
|
||||||
# for f in ${OSG_EXTRA}
|
|
||||||
# do
|
|
||||||
# echo "Copying library ${f}"
|
|
||||||
# cp /usr/local/lib/{$f} "${APP}/Contents/Plugins/${f}"
|
|
||||||
# echo "Changing package identification of ${f}
|
|
||||||
# install_name_tool -id \
|
|
||||||
# @executable_path/../Frameworks/SDL.framework/Versions/A/SDL \
|
|
||||||
# "${APP}/Contents/Frameworks/SDL.framework/Versions/A/SDL"
|
|
||||||
#done
|
|
||||||
|
|
||||||
# deleting unnecessary files
|
# deleting unnecessary files
|
||||||
echo "Deleting unnecessary files"
|
echo "Deleting unnecessary files"
|
||||||
# find "${APP}/Contents/Frameworks" -iname "current" -exec rm -rf \{\} \;
|
|
||||||
# find "${APP}/Contents/Frameworks" -iname "4.0" -exec rm -rf \{\} \;
|
|
||||||
find "${APP}/Contents/Frameworks" -iname "*_debug" -exec rm -rf \{\} \;
|
find "${APP}/Contents/Frameworks" -iname "*_debug" -exec rm -rf \{\} \;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user