Commit 6362e4c7 authored by Don Gagne's avatar Don Gagne

Restructure location plugin build

Restructured to better fit existing build structure
parent c315ff4e
......@@ -17,7 +17,7 @@
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------
message(Qt version $$[QT_VERSION])
include(QGCCommon.pri)
TARGET = qgroundcontrol
......@@ -27,120 +27,45 @@ exists(user_config.pri):infile(user_config.pri, CONFIG) {
message($$sprintf("Using user-supplied additional config: '%1' specified in user_config.pri", $$fromfile(user_config.pri, CONFIG)))
}
# Setup our supported build types. We do this once here and then use the defined config scopes
# to allow us to easily modify suported build types in one place instead of duplicated throughout
# the project file.
!equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 3) {
error("Unsupported Qt version, 5.4+ is required")
}
linux {
linux-g++ | linux-g++-64 {
message("Linux build")
CONFIG += LinuxBuild link_pkgconfig
} else {
error("Unsuported Linux toolchain, only GCC 32- or 64-bit is supported")
}
} else : win32 {
win32-msvc2010 | win32-msvc2012 | win32-msvc2013 {
message("Windows build")
CONFIG += WindowsBuild
} else {
error("Unsupported Windows toolchain, only Visual Studio 2010, 2012, and 2013 are supported")
}
} else : macx {
macx-clang | macx-llvm {
message("Mac build")
CONFIG += MacBuild
QMAKE_CXXFLAGS += -fvisibility=hidden
} else {
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
}
} else {
error("Unsupported build platform, only Linux, Windows, and Mac are supported")
}
# Installer configuration
installer {
CONFIG -= debug
CONFIG -= debug_and_release
CONFIG += release
message(Build Installer)
}
# Setup our supported build flavors
CONFIG(debug, debug|release) {
message(Debug flavor)
CONFIG += DebugBuild
} else:CONFIG(release, debug|release) {
message(Release flavor)
CONFIG += ReleaseBuild
} else {
error(Unsupported build flavor)
}
# Need to special case Windows debug_and_release since VS Project creation in this case does strange things [QTBUG-40351]
win32:debug_and_release {
CONFIG += WindowsDebugAndRelease
}
# Setup our build directories
BASEDIR = $${IN_PWD}
DebugBuild {
DESTDIR = $${OUT_PWD}/debug
BUILDDIR = $${OUT_PWD}/build-debug
}
ReleaseBuild {
DESTDIR = $${OUT_PWD}/release
BUILDDIR = $${OUT_PWD}/build-release
LinuxBuild {
CONFIG += link_pkgconfig
}
OBJECTS_DIR = $${BUILDDIR}/obj
MOC_DIR = $${BUILDDIR}/moc
UI_DIR = $${BUILDDIR}/ui
RCC_DIR = $${BUILDDIR}/rcc
LANGUAGE = C++
message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET)
# QGC QtLocation
# QGC QtLocation plugin
QGCMAPDIR = $${OUT_PWD}/libs/QtLocationQGC/plugins/geoservices
LIBS += -L$${LOCATION_PLUGIN_DESTDIR}
LinuxBuild {
LIBS += -L$$QGCMAPDIR -lqtgeoservices_qgc
PRE_TARGETDEPS += $$QGCMAPDIR/libqtgeoservices_qgc.a
LIBS += -l$${LOCATION_PLUGIN_NAME}
PRE_TARGETDEPS += $${LOCATION_PLUGIN_DESTDIR}/lib$${LOCATION_PLUGIN_NAME}.a
}
WindowsBuild {
DebugBuild {
LIBS += -L$$QGCMAPDIR -lqtgeoservices_qgcd
PRE_TARGETDEPS += $$QGCMAPDIR/qtgeoservices_qgcd.lib
LIBS += -l$${LOCATION_PLUGIN_NAME}d
PRE_TARGETDEPS += $${LOCATION_PLUGIN_DESTDIR}/$${LOCATION_PLUGIN_NAME}d.lib
}
ReleaseBuild {
LIBS += -L$$QGCMAPDIR -lqtgeoservices_qgc
PRE_TARGETDEPS += $$QGCMAPDIR/qtgeoservices_qgc.lib
LIBS += -l$${LOCATION_PLUGIN_NAME}
PRE_TARGETDEPS += $${LOCATION_PLUGIN_DESTDIR}/$${LOCATION_PLUGIN_NAME}.lib
}
}
MacBuild {
DebugBuild {
LIBS += -L$$QGCMAPDIR -lqtgeoservices_qgc_debug
PRE_TARGETDEPS += $$QGCMAPDIR/libqtgeoservices_qgc_debug.a
LIBS += -l$${LOCATION_PLUGIN_NAME}_debug
PRE_TARGETDEPS += $${LOCATION_PLUGIN_DESTDIR}/lib$${LOCATION_PLUGIN_NAME}_debug.a
}
ReleaseBuild {
LIBS += -L$$QGCMAPDIR -lqtgeoservices_qgc
PRE_TARGETDEPS += $$QGCMAPDIR/libqtgeoservices_qgc.a
LIBS += -l$${LOCATION_PLUGIN_NAME}
PRE_TARGETDEPS += $${LOCATION_PLUGIN_DESTDIR}/lib$${LOCATION_PLUGIN_NAME}.a
}
}
# Qt configuration
CONFIG += qt \
thread
......@@ -156,7 +81,9 @@ QT += network \
printsupport \
qml \
quick \
quickwidgets
quickwidgets \
location \
positioning
contains(DEFINES, QGC_NOTIFY_TUNES_ENABLED) {
QT += multimedia
......@@ -165,65 +92,24 @@ contains(DEFINES, QGC_NOTIFY_TUNES_ENABLED) {
# testlib is needed even in release flavor for QSignalSpy support
QT += testlib
# Turn off serial port warnings
DEFINES += _TTY_NOWARN_
#
# OS Specific settings
#
MacBuild {
QMAKE_INFO_PLIST = Custom-Info.plist
CONFIG += x86_64
CONFIG -= x86
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
QMAKE_MAC_SDK = macosx10.9
ICON = $$BASEDIR/resources/icons/macx.icns
QT += quickwidgets
}
LinuxBuild {
DEFINES += __STDC_LIMIT_MACROS
CONFIG += qesp_linux_udev
}
WindowsBuild {
DEFINES += __STDC_LIMIT_MACROS
# Specify multi-process compilation within Visual Studio.
# (drastically improves compilation times for multi-core computers)
QMAKE_CXXFLAGS_DEBUG += -MP
QMAKE_CXXFLAGS_RELEASE += -MP
RC_FILE = $$BASEDIR/qgroundcontrol.rc
}
#
# By default warnings as errors are turned off. Even so, in order for a pull request
# to be accepted you must compile cleanly with warnings as errors turned on the default
# set of OS builds. See http://www.qgroundcontrol.org/dev/contribute for more details.
# You can use the WarningsAsErrorsOn CONFIG switch to turn warnings as errors on for your
# own builds.
#
MacBuild | LinuxBuild {
QMAKE_CXXFLAGS_WARN_ON += -Wall
WarningsAsErrorsOn {
QMAKE_CXXFLAGS_WARN_ON += -Werror
}
}
WindowsBuild {
QMAKE_CXXFLAGS_WARN_ON += /W3 \
/wd4996 \ # silence warnings about deprecated strcpy and whatnot
/wd4005 \ # silence warnings about macro redefinition
/wd4290 \ # ignore exception specifications
/Zc:strictStrings- # work around win 8.1 sdk sapi.h problem
WarningsAsErrorsOn {
QMAKE_CXXFLAGS_WARN_ON += /WX
}
}
#
# Build-specific settings
#
......@@ -232,16 +118,6 @@ DebugBuild {
CONFIG += console
}
ReleaseBuild {
DEFINES += QT_NO_DEBUG
WindowsBuild {
# Use link time code generation for better optimization (I believe this is supported in MSVC Express, but not 100% sure)
QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_CFLAGS_LTCG = -GL
}
}
# qextserialport should not be used by general QGroundControl code. Use QSerialPort instead. This is only
# here to support special case Firmware Upgrade code.
include(libs/qextserialport/src/qextserialport.pri)
......@@ -270,10 +146,6 @@ include(QGCInstaller.pri)
RESOURCES += qgroundcontrol.qrc
TRANSLATIONS += \
es-MX.ts \
en-US.ts
DEPENDPATH += \
. \
plugins
......@@ -678,8 +550,6 @@ SOURCES += \
DebugBuild|WindowsDebugAndRelease {
DEFINES += UNITTEST_BUILD
INCLUDEPATH += \
src/qgcunittest
......
# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# This file is part of the open groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# QGroundControl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------
#
# This file contains configuration settings which are common to both the QGC Application and
# the Location Plugin. It should mainly contains intial CONFIG tag setup and compiler settings.
#
# Setup our supported build types. We do this once here and then use the defined config scopes
# to allow us to easily modify suported build types in one place instead of duplicated throughout
# the project file.
linux {
linux-g++ | linux-g++-64 {
message("Linux build")
CONFIG += LinuxBuild
} else {
error("Unsuported Linux toolchain, only GCC 32- or 64-bit is supported")
}
} else : win32 {
win32-msvc2010 | win32-msvc2012 | win32-msvc2013 {
message("Windows build")
CONFIG += WindowsBuild
} else {
error("Unsupported Windows toolchain, only Visual Studio 2010, 2012, and 2013 are supported")
}
} else : macx {
macx-clang | macx-llvm {
message("Mac build")
CONFIG += MacBuild
QMAKE_CXXFLAGS += -fvisibility=hidden
} else {
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
}
} else {
error("Unsupported build platform, only Linux, Windows, and Mac are supported")
}
# Installer configuration
installer {
CONFIG -= debug
CONFIG -= debug_and_release
CONFIG += release
message(Build Installer)
}
# Setup our supported build flavors
CONFIG(debug, debug|release) {
message(Debug flavor)
CONFIG += DebugBuild
} else:CONFIG(release, debug|release) {
message(Release flavor)
CONFIG += ReleaseBuild
} else {
error(Unsupported build flavor)
}
# Need to special case Windows debug_and_release since VS Project creation in this case does strange things [QTBUG-40351]
win32:debug_and_release {
CONFIG += WindowsDebugAndRelease
}
# Setup our build directories
BASEDIR = $${IN_PWD}
DebugBuild {
DESTDIR = $${OUT_PWD}/debug
BUILDDIR = $${OUT_PWD}/build-debug
}
ReleaseBuild {
DESTDIR = $${OUT_PWD}/release
BUILDDIR = $${OUT_PWD}/build-release
}
LOCATION_PLUGIN_DESTDIR = $${BUILDDIR}/QGCLocationPlugin
LOCATION_PLUGIN_NAME = QGeoServiceProviderFactoryQGC
OBJECTS_DIR = $${BUILDDIR}/obj
MOC_DIR = $${BUILDDIR}/moc
UI_DIR = $${BUILDDIR}/ui
RCC_DIR = $${BUILDDIR}/rcc
LANGUAGE = C++
message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET)
# Turn off serial port warnings
DEFINES += _TTY_NOWARN_
#
# OS Specific settings
#
MacBuild {
CONFIG += x86_64
CONFIG -= x86
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
QMAKE_MAC_SDK = macosx10.9
}
LinuxBuild {
DEFINES += __STDC_LIMIT_MACROS
}
WindowsBuild {
DEFINES += __STDC_LIMIT_MACROS
# Specify multi-process compilation within Visual Studio.
# (drastically improves compilation times for multi-core computers)
QMAKE_CXXFLAGS_DEBUG += -MP
QMAKE_CXXFLAGS_RELEASE += -MP
}
#
# By default warnings as errors are turned off. Even so, in order for a pull request
# to be accepted you must compile cleanly with warnings as errors turned on the default
# set of OS builds. See http://www.qgroundcontrol.org/dev/contribute for more details.
# You can use the WarningsAsErrorsOn CONFIG switch to turn warnings as errors on for your
# own builds.
#
MacBuild | LinuxBuild {
QMAKE_CXXFLAGS_WARN_ON += -Wall
WarningsAsErrorsOn {
QMAKE_CXXFLAGS_WARN_ON += -Werror
}
}
WindowsBuild {
QMAKE_CXXFLAGS_WARN_ON += /W3 \
/wd4996 \ # silence warnings about deprecated strcpy and whatnot
/wd4005 \ # silence warnings about macro redefinition
/wd4290 \ # ignore exception specifications
/Zc:strictStrings- # work around win 8.1 sdk sapi.h problem
WarningsAsErrorsOn {
QMAKE_CXXFLAGS_WARN_ON += /WX
}
}
#
# Build-specific settings
#
ReleaseBuild {
DEFINES += QT_NO_DEBUG
WindowsBuild {
# Use link time code generation for better optimization (I believe this is supported in MSVC Express, but not 100% sure)
QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_CFLAGS_LTCG = -GL
}
}
#
# Unit Test specific configuration goes here
#
# We have to special case Windows debug_and_release builds because you can't have files
# which are only in the debug variant [QTBUG-40351]. So in this case we include unit tests
# even in the release variant. If you want a Windows release build with no unit tests run
# qmake with CONFIG-=debug_and_release CONFIG+=release.
#
DebugBuild|WindowsDebugAndRelease {
DEFINES += UNITTEST_BUILD
}
include(QGCCommon.pri)
TEMPLATE = lib
TARGET = $$qtLibraryTarget(QGeoServiceProviderFactoryQGC)
CONFIG += plugin static
QT += location-private positioning-private network
PLUGIN_TYPE = geoservices
DESTDIR = $${LOCATION_PLUGIN_DESTDIR}
INCLUDEPATH += $$QT.location.includes
HEADERS += \
src/QtLocationPlugin/qgeoserviceproviderpluginqgc.h \
src/QtLocationPlugin/qgeotiledmappingmanagerengineqgc.h \
src/QtLocationPlugin/qgeotilefetcherqgc.h \
src/QtLocationPlugin/qgeomapreplyqgc.h \
src/QtLocationPlugin/qgeocodingmanagerengineqgc.h \
src/QtLocationPlugin/qgeocodereplyqgc.h \
src/QtLocationPlugin/OpenPilotMaps.h
SOURCES += \
src/QtLocationPlugin/qgeoserviceproviderpluginqgc.cpp \
src/QtLocationPlugin/qgeotiledmappingmanagerengineqgc.cpp \
src/QtLocationPlugin/qgeotilefetcherqgc.cpp \
src/QtLocationPlugin/qgeomapreplyqgc.cpp \
src/QtLocationPlugin/qgeocodingmanagerengineqgc.cpp \
src/QtLocationPlugin/qgeocodereplyqgc.cpp \
src/QtLocationPlugin/OpenPilotMaps.cc
OTHER_FILES += \
src/QtLocationPlugin/qgc_maps_plugin.json
load(qt_build_config)
MODULE_VERSION = 5.4.1
TARGET = qtgeoservices_qgc
CONFIG += static
QT += location-private positioning-private network
PLUGIN_TYPE = geoservices
PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryQGC
load(qt_plugin)
INCLUDEPATH += $$QT.location.includes
HEADERS += \
$$PWD/src/qgeoserviceproviderpluginqgc.h \
$$PWD/src/qgeotiledmappingmanagerengineqgc.h \
$$PWD/src/qgeotilefetcherqgc.h \
$$PWD/src/qgeomapreplyqgc.h \
$$PWD/src/qgeocodingmanagerengineqgc.h \
$$PWD/src/qgeocodereplyqgc.h \
$$PWD/src/OpenPilotMaps.h
SOURCES += \
$$PWD/src/qgeoserviceproviderpluginqgc.cpp \
$$PWD/src/qgeotiledmappingmanagerengineqgc.cpp \
$$PWD/src/qgeotilefetcherqgc.cpp \
$$PWD/src/qgeomapreplyqgc.cpp \
$$PWD/src/qgeocodingmanagerengineqgc.cpp \
$$PWD/src/qgeocodereplyqgc.cpp \
$$PWD/src/OpenPilotMaps.cc
OTHER_FILES += \
$$PWD/qgc_maps_plugin.json
......@@ -19,8 +19,14 @@
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = libs/QtLocationQGC
SUBDIRS += ./qgcsystem.pro
SUBDIRS = ./QGCLocationPlugin.pro
SUBDIRS += ./QGCApplication.pro
qgcsystem.depends = QtLocationQGC
QGCApplication.depends = QGCLocationPlugin
message(Qt version $$[QT_VERSION])
!equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 3) {
error("Unsupported Qt version, 5.4+ is required")
}
......@@ -51,12 +51,9 @@
#include <QtPositioning/QGeoAddress>
#include <QtPositioning/QGeoLocation>
#include <QtPositioning/QGeoRectangle>
#include <unordered_map>
#include "qgeocodereplyqgc.h"
QT_BEGIN_NAMESPACE
enum QGeoCodeTypeGoogle {
GeoCodeTypeUnknown,
StreetAddress, // indicates a precise street address.
......@@ -297,5 +294,3 @@ void QGeoCodeReplyQGC::networkReplyError(QNetworkReply::NetworkError error)
m_reply->deleteLater();
m_reply = 0;
}
QT_END_NAMESPACE
......@@ -50,8 +50,6 @@
#include <QtNetwork/QNetworkReply>
#include <QtLocation/QGeoCodeReply>
QT_BEGIN_NAMESPACE
class QGeoCodeReplyQGC : public QGeoCodeReply
{
Q_OBJECT
......@@ -70,6 +68,4 @@ private:
QNetworkReply *m_reply;
};
QT_END_NAMESPACE
#endif // QGEOCODEREPLYGOOGLE_H
......@@ -58,8 +58,6 @@
#include "qgeocodingmanagerengineqgc.h"
#include "qgeocodereplyqgc.h"
QT_BEGIN_NAMESPACE
static QString addressToQuery(const QGeoAddress &address)
{
return address.street() + QStringLiteral(", ") +
......@@ -177,5 +175,3 @@ void QGeoCodingManagerEngineQGC::replyError(QGeoCodeReply::Error errorCode, cons
if (reply)
emit error(reply, errorCode, errorString);
}
QT_END_NAMESPACE
......@@ -50,8 +50,6 @@
#include <QtNetwork/QNetworkReply>
#include <QtLocation/private/qgeotiledmapreply_p.h>
QT_BEGIN_NAMESPACE
class QGeoMapReplyQGC : public QGeoTiledMapReply
{
Q_OBJECT
......@@ -73,6 +71,4 @@ private:
QNetworkReply* m_reply;
};
QT_END_NAMESPACE
#endif // QGEOMAPREPLYGOOGLE_H
......@@ -51,8 +51,6 @@
#include "qgeotiledmappingmanagerengineqgc.h"
#include "qgeocodingmanagerengineqgc.h"
QT_BEGIN_NAMESPACE
QGeoCodingManagerEngine *QGeoServiceProviderFactoryQGC::createGeocodingManagerEngine(
const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
{
......@@ -78,5 +76,3 @@ QPlaceManagerEngine *QGeoServiceProviderFactoryQGC::createPlaceManagerEngine(
// Not implemented for QGC
return NULL;
}
QT_END_NAMESPACE
......@@ -49,8 +49,7 @@
#include <QtCore/QObject>
#include <QtLocation/QGeoServiceProviderFactory>
QT_BEGIN_NAMESPACE
#include <QtPlugin>
class QGeoServiceProviderFactoryQGC: public QObject, public QGeoServiceProviderFactory
{
......@@ -65,6 +64,4 @@ public:
QPlaceManagerEngine* createPlaceManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const;
};
QT_END_NAMESPACE
#endif // QGEOSERVICEPROVIDER_GOOGLE_H
......@@ -54,8 +54,6 @@
#include "qgeotilefetcherqgc.h"
#include "OpenPilotMaps.h"
QT_BEGIN_NAMESPACE
QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString)
: QGeoTiledMappingManagerEngine()
{
......@@ -162,5 +160,3 @@ QGeoMapData *QGeoTiledMappingManagerEngineQGC::createMapData()
{
return new QGeoTiledMapData(this, 0);
}
QT_END_NAMESPACE
......@@ -50,8 +50,6 @@
#include <QtLocation/QGeoServiceProvider>
#include <QtLocation/private/qgeotiledmappingmanagerengine_p.h>
QT_BEGIN_NAMESPACE
class QGeoTiledMappingManagerEngineQGC : public QGeoTiledMappingManagerEngine
{
Q_OBJECT
......@@ -61,6 +59,4 @@ public:
QGeoMapData *createMapData();
};
QT_END_NAMESPACE
#endif // QGEOTILEDMAPPINGMANAGERENGINEGOOGLE_H
......@@ -52,8 +52,6 @@
#include "qgeotilefetcherqgc.h"
#include "qgeomapreplyqgc.h"
QT_BEGIN_NAMESPACE
QGeoTileFetcherQGC::QGeoTileFetcherQGC(QGeoTiledMappingManagerEngine *parent)
: QGeoTileFetcher(parent)
, m_networkManager(new QNetworkAccessManager(this))
......@@ -146,5 +144,3 @@ QGeoTiledMapReply *QGeoTileFetcherQGC::getTileImage(const QGeoTileSpec &spec)
return new QGeoMapReplyQGC(reply, spec);
}
QT_END_NAMESPACE
......@@ -51,8 +51,6 @@
#include <QtLocation/private/qgeotilecache_p.h>
#include "OpenPilotMaps.h"
QT_BEGIN_NAMESPACE
class QGeoTiledMappingManagerEngine;
class QNetworkAccessManager;
......@@ -73,6 +71,4 @@ private:
QString m_Language;
};
QT_END_NAMESPACE
#endif // QGEOTILEFETCHERGOOGLE_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment