1
0
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:
Alessio Morale 2013-11-13 15:26:51 +01:00
commit fa2b6c30ef
13 changed files with 60 additions and 87 deletions

1
.gitignore vendored
View File

@ -25,6 +25,7 @@ GTAGS
openpilotgcs-build-desktop
# Ignore some of the .pro.user files
*.pro.user
/ground/openpilotgcs/openpilotgcs.pro.user
/ground/uavobjgenerator/uavobjgenerator.pro.user
/ground/uavobjects/uavobjects.pro.user

View File

@ -30,6 +30,8 @@
# qt-creator users. Top level Makefile handles all dependencies itself
# 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")
TEMPLATE = subdirs

View File

@ -3,10 +3,24 @@
# Copyright (c) 2009-2013, The OpenPilot Team, http://www.openpilot.org
#
#version check qt
contains(QT_VERSION, ^4\\.[0-7]\\..*) {
message("Cannot build OpenPilot GCS with Qt version $${QT_VERSION}.")
error("Cannot build OpenPilot GCS with Qt version $${QT_VERSION}. Use at least Qt 4.8!")
cache()
#check Qt version
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)

View File

@ -12,8 +12,11 @@ defineReplace(prependAll) {
}
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)
LCONVERT = $$targetPath($$[QT_INSTALL_BINS]/lconvert)
wd = $$replace(GCS_SOURCE_TREE, /, $$QMAKE_DIR_SEP)
TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/openpilotgcs_,.ts)
@ -34,7 +37,7 @@ QMAKE_EXTRA_TARGETS += ts
TEMPLATE = app
TARGET = phony_target2
CONFIG -= qt
CONFIG -= qt sdk separate_debug_info gdb_dwarf_index
QT =
LIBS =

View File

@ -21,6 +21,16 @@
TEMPLATE = lib
TARGET = sdlgamepad
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)
@ -28,7 +38,7 @@ SOURCES += sdlgamepad.cpp
HEADERS += sdlgamepad.h \
sdlgamepad_global.h
macx:LIBS += -framework SDL
macx:LIBS += -framework OpenGL -framework SDL -framework Cocoa
!macx:LIBS += -lSDL
OTHER_FILES += COPYING \

View File

@ -20,7 +20,6 @@ HEADERS += configplugin.h \
configpipxtremewidget.h \
configstabilizationwidget.h \
assertions.h \
calibration.h \
defaultattitudewidget.h \
defaulthwsettingswidget.h \
inputchannelform.h \
@ -51,10 +50,7 @@ SOURCES += configplugin.cpp \
configccattitudewidget.cpp \
configstabilizationwidget.cpp \
configpipxtremewidget.cpp \
twostep.cpp \
legacy-calibration.cpp \
gyro-calibration.cpp \
alignment-calibration.cpp \
defaultattitudewidget.cpp \
defaulthwsettingswidget.cpp \
inputchannelform.cpp \

View File

@ -171,9 +171,6 @@ MainWindow::MainWindow() :
m_modeStack->setMovable(false);
m_modeStack->setMinimumWidth(512);
m_modeStack->setElideMode(Qt::ElideRight);
#ifndef Q_WS_MAC
m_modeStack->setDocumentMode(true);
#endif
m_modeManager = new ModeManager(this, m_modeStack);
m_connectionManager = new ConnectionManager(this);

View File

@ -9,6 +9,18 @@ include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/uavobjects/uavobjects.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 \
gcscontrolgadgetconfiguration.h \
gcscontrolgadgetoptionspage.h

View File

@ -4,6 +4,7 @@ include(../../openpilotgcsplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
include(../../libs/glc_lib/glc_lib.pri)
include(modelview_dependencies.pri)
INCLUDEPATH += ../../libs/glc_lib
HEADERS += modelviewplugin.h \
modelviewgadgetconfiguration.h \

View File

@ -25,7 +25,9 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "QtDebug"
#ifdef __APPLE__
#include "OpenGL/OpenGL.h"
#endif
#include "modelviewgadgetwidget.h"
#include "extensionsystem/pluginmanager.h"
#include "glc_context.h"

View File

@ -29,7 +29,6 @@
#define OPHID_CONST_H
#include "QtDebug"
#define printf qDebug
#define OPHID_DEBUG_ON 1
#ifdef OPHID_DEBUG_ON
#define OPHID_DEBUG(fmt, args ...) qDebug("[DEBUG] "fmt,##args)

View File

@ -34,14 +34,8 @@ win32 {
macx {
SOURCES += src/ophid_usbmon_mac.cpp \
hidapi/mac/hid.c
SDK = /Developer/SDKs/MacOSX10.5.sdk
ARCH = -mmacosx-version-min=10.5 \
-arch ppc \
-arch i386
LIBS += $(ARCH) \
-Wl,-syslibroot,$(SDK) \
-framework IOKit \
-framework CoreFoundation
LIBS += -framework CoreFoundation \
-framework IOKit
}
linux-g++ {

View File

@ -3,9 +3,9 @@
APP="${1?}"
PLUGINS="${APP}/Contents/Plugins"
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_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"
@ -24,7 +24,7 @@ fi
echo "Qt library directory is \"${QT_DIR}\""
echo "Running macdeployqt"
macdeployqt "${APP}"
macdeployqt "${APP}" -no-strip
echo "Processing Qt libraries in ${APP}"
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib
@ -33,57 +33,12 @@ do
[ ! -L "${f}" ] && 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} \
"${QT_DIR}${g}.framework/Versions/5/${g}" \
@executable_path/../Frameworks/${g}.framework/Versions/5/${g} \
"${f}"
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"
cp -a "/Library/Frameworks/SDL.framework" "${APP}/Contents/Frameworks/"
@ -96,19 +51,6 @@ install_name_tool -change \
"@executable_path/../Frameworks/SDL.framework/SDL" \
"${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
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 \{\} \;