From b4d0a93133b69058e72ab846b3b4bcf374c58188 Mon Sep 17 00:00:00 2001 From: Patrick Huebner Date: Wed, 13 Nov 2013 21:04:57 +1100 Subject: [PATCH] OP-1103 Some minor cleanup work and adding a version check for Qt5.1 --- ground/openpilotgcs/openpilotgcs.pro | 16 +++-- .../src/plugins/config/config.pro | 4 -- .../src/plugins/ophid/inc/ophid_const.h | 1 - package/osx/libraries | 58 ------------------- 4 files changed, 11 insertions(+), 68 deletions(-) diff --git a/ground/openpilotgcs/openpilotgcs.pro b/ground/openpilotgcs/openpilotgcs.pro index 7a15108ab..6705d5afd 100644 --- a/ground/openpilotgcs/openpilotgcs.pro +++ b/ground/openpilotgcs/openpilotgcs.pro @@ -3,12 +3,18 @@ # 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 diff --git a/ground/openpilotgcs/src/plugins/config/config.pro b/ground/openpilotgcs/src/plugins/config/config.pro index 2049cfac1..b3ff5dc78 100644 --- a/ground/openpilotgcs/src/plugins/config/config.pro +++ b/ground/openpilotgcs/src/plugins/config/config.pro @@ -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 \ diff --git a/ground/openpilotgcs/src/plugins/ophid/inc/ophid_const.h b/ground/openpilotgcs/src/plugins/ophid/inc/ophid_const.h index 2d6dbdcdc..bd8a429a3 100644 --- a/ground/openpilotgcs/src/plugins/ophid/inc/ophid_const.h +++ b/ground/openpilotgcs/src/plugins/ophid/inc/ophid_const.h @@ -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) diff --git a/package/osx/libraries b/package/osx/libraries index 6515255ef..5c091c485 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -39,51 +39,6 @@ do 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/5/${f} \ - #"${APP}/Contents/Frameworks/${f}.framework/Versions/5/${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/5/${g}" \ - #@executable_path/../Frameworks/${g}.framework/Versions/5/${g} \ - #"${APP}/Contents/Frameworks/${f}.framework/Versions/5/${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/5/${g}" \ - #@executable_path/../Frameworks/${g}.framework/Versions/5/${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 \{\} \;