Added qmake project files / standardized #includes

This commit is contained in:
Roland Winklmeier
2013-03-16 18:44:46 +01:00
parent 9b79949eb4
commit f6daa0623e
43 changed files with 577 additions and 61 deletions

62
client.pro Normal file
View File

@@ -0,0 +1,62 @@
TEMPLATE = subdirs
CONFIG += ordered
WITH_BLACKMISC = ON
WITH_BLACKCORE = ON
WITH_BLACKD = ON
WITH_BLACKBOX = ON
WITH_SAMPLES = ON
#WITH_DRIVER_FSX = ON
#WITH_DRIVER_FS9 = ON
#WITH_DRIVER_XPLANE = ON
equals(WITH_BLACKMISC, ON) {
SUBDIRS += src/blackmisc
}
equals(WITH_BLACKCORE, ON) {
SUBDIRS += src/blackcore
}
equals(WITH_BLACKD, ON) {
SUBDIRS += src/blackd
}
equals(WITH_BLACKBOX, ON) {
SUBDIRS += src/blackbox
}
equals(WITH_DRIVER_FSX, ON) {
SUBDIRS += src/driver/fsx
}
equals(WITH_DRIVER_FS9, ON) {
SUBDIRS += src/driver/fs9
}
equals(WITH_DRIVER_XPLANE, ON) {
SUBDIRS += src/driver/xplane
}
equals(WITH_SAMPLES, ON) {
SUBDIRS += samples/com_client
SUBDIRS += samples/com_server
SUBDIRS += samples/config
SUBDIRS += samples/Geodetic2Ecef
SUBDIRS += samples/interpolator
SUBDIRS += samples/Logging
}
SUBDIRS +=

View File

@@ -0,0 +1,35 @@
QT += core
QT -= gui
TARGET = sample_geo2ecef
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
DEPENDPATH += . ../../src
INCLUDEPATH += . ../../src
SOURCES += main.cpp\
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
LIBS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
LIBS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
}
DESTDIR = ../../bin

View File

@@ -1,12 +1,12 @@
#include <QCoreApplication>
#include <QElapsedTimer>
#include <blackmisc/debug.h>
#include "blackmisc/debug.h"
#include <iostream>
#include <conio.h>
#include <windows.h>
#include <blackcore/ecef.h>
#include <blackcore/vector_geo.h>
#include "blackcore/ecef.h"
#include "blackcore/vector_geo.h"
using namespace std;

View File

@@ -0,0 +1,31 @@
QT += core
QT -= gui
TARGET = sample_logging
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
DEPENDPATH += . ../../src
INCLUDEPATH += . ../../src
SOURCES += main.cpp\
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
LIBS += ../../lib/blackmisc.lib \
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
LIBS += ../../lib/libblackmisc.a \
}
DESTDIR = ../../bin

View File

@@ -1,6 +1,6 @@
#include <QCoreApplication>
#include <blackmisc/debug.h>
#include <blackcore/constants.h>
#include "blackmisc/debug.h"
#include "blackcore/constants.h"
#include <limits>
#include <iostream>

View File

@@ -1,5 +1,5 @@
#include <blackmisc/message_system.h>
#include <blackmisc/com_client.h>
#include "blackmisc/message_system.h"
#include "blackmisc/com_client.h"
class Client : public QObject
{
@@ -16,4 +16,4 @@ protected slots:
private:
BlackMisc::CComClient comclient;
};
};

View File

@@ -0,0 +1,35 @@
QT += core network
QT -= gui
TARGET = com_client
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
DEPENDPATH += . ../../src
INCLUDEPATH += . ../../src
SOURCES += main.cpp\
client.cpp
HEADERS += client.h
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
LIBS += ../../lib/blackmisc.lib \
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
LIBS += ../../lib/libblackmisc.a \
}
DESTDIR = ../../bin

View File

@@ -1,6 +1,6 @@
#include <QApplication>
#include <QCoreApplication>
#include <blackmisc/context.h>
#include "blackmisc/context.h"
#include "client.h"
using namespace BlackMisc;
@@ -8,7 +8,7 @@ using namespace BlackMisc;
int main(int argc, char *argv[])
{
BlackMisc::CApplicationContext myApplicationContext;
QApplication a(argc, argv);
QCoreApplication a(argc, argv);
Client client;

View File

@@ -0,0 +1,34 @@
QT += core network
QT -= gui
TARGET = com_server
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
DEPENDPATH += . ../../src
INCLUDEPATH += . ../../src
SOURCES += main.cpp \
server.cpp
HEADERS += server.h
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
LIBS += ../../lib/blackmisc.lib \
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
LIBS += ../../lib/libblackmisc.a \
}
DESTDIR = ../../bin

View File

@@ -1,6 +1,6 @@
#include <QApplication>
#include <QCoreApplication>
#include <blackmisc/context.h>
#include "blackmisc/context.h"
#include "server.h"
using namespace BlackMisc;
@@ -8,7 +8,7 @@ using namespace BlackMisc;
int main(int argc, char *argv[])
{
BlackMisc::CApplicationContext myApplicationContext;
QApplication a(argc, argv);
QCoreApplication a(argc, argv);
Server server;

View File

@@ -1,4 +1,4 @@
#include <blackmisc/debug.h>
#include "blackmisc/debug.h"
#include "server.h"
using namespace BlackMisc;
@@ -36,4 +36,4 @@ void Server::onData(QString &messageID, QByteArray &message)
void TestMessageHandler::onTestMessage(const TestMessage *testmessage)
{
bDebug << "Message ID: " << testmessage->getID() << " with text: " << testmessage->getTestString();
}
}

View File

@@ -1,5 +1,5 @@
#include <blackmisc/message_system.h>
#include <blackmisc/com_server.h>
#include "blackmisc/message_system.h"
#include "blackmisc/com_server.h"
class TestMessageHandler : public BlackMisc::CMessageHandler
{
@@ -29,4 +29,4 @@ protected slots:
private:
BlackMisc::CComServer server;
TestMessageHandler myHandler;
};
};

28
samples/config/config.pro Normal file
View File

@@ -0,0 +1,28 @@
QT += core network
QT -= gui
TARGET = sample_config
TEMPLATE = app
DEPENDPATH += . ../../src
INCLUDEPATH += . ../../src
SOURCES += main.cpp\
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
LIBS += ../../lib/blackmisc.lib \
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
LIBS += ../../lib/libblackmisc.a \
}
DESTDIR = ../../bin

View File

@@ -1,7 +1,7 @@
#include <QCoreApplication>
#include <blackmisc/debug.h>
#include <blackmisc/config_manager.h>
#include <blackmisc/config.h>
#include "blackmisc/debug.h"
#include "blackmisc/config_manager.h"
#include "blackmisc/config.h"
#include <limits>
#include <iostream>

View File

@@ -0,0 +1,35 @@
QT += core
QT -= gui
TARGET = sample_interpolator
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
DEPENDPATH += . ../../src
INCLUDEPATH += . ../../src
SOURCES += main.cpp\
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
LIBS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
LIBS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
}
DESTDIR = ../../bin

View File

@@ -5,10 +5,10 @@
#include <iostream>
#include <blackcore/matrix_3d.h>
#include <blackcore/vector_geo.h>
#include <blackcore/vector_3d.h>
#include <blackcore/interpolator.h>
#include "blackcore/matrix_3d.h"
#include "blackcore/vector_geo.h"
#include "blackcore/vector_3d.h"
#include "blackcore/interpolator.h"
using namespace std;
using namespace BlackCore;

31
src/blackbox/blackbox.pro Normal file
View File

@@ -0,0 +1,31 @@
QT += core gui xml svg network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
INCLUDEPATH += . ..
TARGET = BlackBox
TEMPLATE = app
SOURCES += main.cpp\
blackbox.cpp \
dialog_chat.cpp \
dialog_connect.cpp
HEADERS += blackbox.h \
dialog_chat.h \
dialog_connect.h
FORMS += blackbox.ui dialog_connect.ui dialog_chat.ui
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib
LIBS += ../../lib/blackmisc.lib
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a
LIBS += ../../lib/libblackmisc.a
}
DESTDIR = ../../bin

View File

@@ -6,9 +6,9 @@
#include "dialog_connect.h"
#include "ui_dialog_connect.h"
#include <blackmisc/debug.h>
#include <blackmisc/message.h>
#include <blackmisc/gui_messages.h>
#include "blackmisc/debug.h"
#include "blackmisc/message.h"
#include "blackmisc/gui_messages.h"
using namespace BlackMisc;

View File

@@ -7,7 +7,7 @@
#define DIALOG_CONNECT_H
#include <QDialog>
#include <blackmisc/com_client.h>
#include "blackmisc/com_client.h"
namespace Ui {
class CDialogConnect;

View File

@@ -5,8 +5,8 @@
#include "blackbox.h"
#include <QApplication>
#include <blackmisc/context.h>
#include <blackmisc/debug.h>
#include "blackmisc/context.h"
#include "blackmisc/debug.h"
int main(int argc, char *argv[])
{

View File

@@ -0,0 +1,52 @@
QT += network
TARGET = blackcore
TEMPLATE = lib
CONFIG += staticlib
INCLUDEPATH += ..
DEPENDPATH += . ..
#PRECOMPILED_HEADER = stdpch.h
precompile_header:!isEmpty(PRECOMPILED_HEADER) {
DEFINES += USING_PCH
}
DEFINES += LOG_IN_FILE
HEADERS += \
sim_callbacks.h \
constants.h \
fsd_protocol.h \
ecef.h \
fsd_client.h \
fsd_messages.h \
interpolator.h \
mathematics.h \
matrix_3d.h \
multiplayer.h \
ned.h \
plane.h \
simulator.h \
vector_3d.h \
vector_geo.h
SOURCES += \
ecef.cpp \
fsd_client.cpp \
fsd_messages.cpp \
interpolator.cpp \
mathematics.cpp \
matrix_3d.cpp \
multiplayer.cpp \
ned.cpp \
plane.cpp \
simulator.cpp \
vector_3d.cpp \
vector_geo.cpp
DESTDIR = ../../lib

View File

@@ -6,7 +6,7 @@
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include "math.h"
#include "mathematics.h"
namespace BlackCore
{

View File

@@ -13,7 +13,7 @@
#include "blackcore/matrix_3d.h"
#include "blackcore/ned.h"
#include "blackcore/ecef.h"
#include "blackcore/math.h"
#include "blackcore/mathematics.h"
#include "blackcore/constants.h"
namespace BlackCore

View File

@@ -34,7 +34,7 @@ public:
CVectorGeo toGeodetic();
//! Assignment operator
void operator= (const CVector3D &rhs);
void operator= (const CVector3D &rhs);
};
} // namespace BlackCore

View File

@@ -4,8 +4,8 @@
#include <QStringList>
#include <QTextStream>
#include <blackcore/fsd_client.h>
#include <blackcore/fsd_messages.h>
#include "blackcore/fsd_client.h"
#include "blackcore/fsd_messages.h"
namespace FSD
{

View File

@@ -1,7 +1,7 @@
#include <iostream>
#include "blackcore/matrix_3d.h"
#include "blackcore/vector_geo.h"
#include "blackcore/math.h"
#include "blackcore/mathematics.h"
#include "blackcore/interpolator.h"
#include "blackcore/constants.h"
@@ -139,7 +139,7 @@ bool CInterpolator::stateNow(TPlaneState *state)
double vNorth = state->velNED.North();
double fraction = vNorth / vEast;
double heading = atan2 (vNorth, vEast);
double heading = atan2 (vNorth, vEast);
state->orientation.heading = heading * Constants::RadToDeg;

View File

@@ -5,7 +5,7 @@
#include <algorithm> // std::max
#include "blackcore/math.h"
#include "blackcore/mathematics.h"
namespace BlackCore {
@@ -30,4 +30,4 @@ double CMath::cubicRootReal(const double x)
return x < 0 ? -result : result;
}
} // namespace BlackCore
} // namespace BlackCore

View File

@@ -9,8 +9,8 @@
#include <QHash>
#include <QString>
#include <qglobal.h>
#include <blackmisc/message_system.h>
#include <blackcore/fsd_messages.h>
#include "blackmisc/message_system.h"
#include "blackcore/fsd_messages.h"
namespace BlackCore {

View File

@@ -1,6 +1,6 @@
#include <blackcore/interpolator.h>
#include <blackcore/simulator.h>
#include <blackmisc/debug.h>
#include "blackcore/interpolator.h"
#include "blackcore/simulator.h"
#include "blackmisc/debug.h"
#include "blackcore/plane.h"
namespace BlackCore {

View File

@@ -5,10 +5,10 @@
#include <QtGui>
#include <blackmisc/context.h>
#include <blackmisc/debug.h>
#include <blackmisc/message_factory.h>
#include <blackcore/fsd_client.h>
#include "blackmisc/context.h"
#include "blackmisc/debug.h"
#include "blackmisc/message_factory.h"
#include "blackcore/fsd_client.h"
#include "qt_displayer.h"

View File

@@ -8,10 +8,10 @@
#include <QSystemTrayIcon>
#include <QDialog>
#include <blackmisc/com_server.h>
#include <blackmisc/gui_messages.h>
#include "blackmisc/com_server.h"
#include "blackmisc/gui_messages.h"
#include <blackmisc/message_system.h>
#include "blackmisc/message_system.h"
namespace Ui {
class BlackD;

47
src/blackd/blackd.pro Normal file
View File

@@ -0,0 +1,47 @@
QT += core gui xml svg network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
TARGET = blackd
TEMPLATE = app
DEPENDPATH += . ..
INCLUDEPATH += ..
SOURCES += main.cpp\
blackd.cpp \
qt_displayer.cpp \
HEADERS += blackd.h \
qt_displayer.h \
FORMS += blackd.ui
RESOURCES += \
blackd.qrc
win32-msvc* {
PRE_TARGETDEPS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
LIBS += ../../lib/blackmisc.lib \
../../lib/blackcore.lib
}
!win32-msvc* {
PRE_TARGETDEPS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
LIBS += ../../lib/libblackmisc.a \
../../lib/libblackcore.a
}
DESTDIR = ../../bin

View File

@@ -3,7 +3,7 @@
//! License, v. 2.0. If a copy of the MPL was not distributed with this
//! file, You can obtain one at http://mozilla.org/MPL/2.0/
#include <blackmisc/context.h>
#include "blackmisc/context.h"
#include "blackd.h"
#include <QApplication>

View File

@@ -6,7 +6,7 @@
#ifndef QT_DISPLAYER_H
#define QT_DISPLAYER_H
#include <blackmisc/display.h>
#include "blackmisc/display.h"
// Qt includes
#include <QPlainTextEdit>

View File

@@ -0,0 +1,64 @@
QT += network
TARGET = blackmisc
TEMPLATE = lib
CONFIG += staticlib
INCLUDEPATH += ..
DEPENDPATH += . ..
#PRECOMPILED_HEADER = stdpch.h
precompile_header:!isEmpty(PRECOMPILED_HEADER) {
DEFINES += USING_PCH
}
DEFINES += LOG_IN_FILE
HEADERS += \
logmessage.h \
log.h \
display.h \
debug.h \
context.h \
config.h \
config_manager.h \
serialize.h \
com_client.h \
com_server.h \
com_client_buffer.h \
message.h \
com_handler.h \
message_factory.h \
message_handler.h \
type_info.h \
message_dispatcher.h \
message_system.h \
gui_messages.h
SOURCES += \
logmessage.cpp \
log.cpp \
display.cpp \
debug.cpp \
context.cpp \
config.cpp \
config_manager.cpp \
serialize.cpp \
com_client.cpp \
com_server.cpp \
com_client_buffer.cpp \
message.cpp \
com_handler.cpp \
message_factory.cpp \
message_handler.cpp \
type_info.cpp \
message_dispatcher.cpp \
message_system.cpp
DESTDIR = ../../lib

View File

@@ -116,6 +116,7 @@ namespace BlackMisc
{
m_configfile = filename;
m_separator = separator;
Q_UNUSED(isRelative);
}
bool CConfig::load()
@@ -224,7 +225,7 @@ namespace BlackMisc
void CConfig::update(const QString &key, const CValue &value)
{
m_value_map[key] = value;
}
void CConfig::display()

View File

@@ -37,7 +37,7 @@ namespace BlackMisc
/// Do not call this, unless you know what you're trying to do (it kills debug)!
void destroy() {}
void changeLogDirectory(const QString &dir) {}
void changeLogDirectory(const QString &dir) { Q_UNUSED(dir); }
QString getLogDirectory();

View File

@@ -6,7 +6,7 @@
#ifndef GUI_MESSAGES_H
#define GUI_MESSAGES_H
#include <blackmisc/message.h>
#include "blackmisc/message.h"
namespace BlackMisc
{
@@ -112,4 +112,4 @@ namespace BlackMisc
};
}
#endif // GUI_MESSAGES_H
#endif // GUI_MESSAGES_H

View File

@@ -3,6 +3,10 @@
//! License, v. 2.0. If a copy of the MPL was not distributed with this
//! file, You can obtain one at http://mozilla.org/MPL/2.0/
#ifndef UNICODE
#define UNICODE
#endif
#include <QTextStream>
#include <QFileInfo>
#include <QtGlobal>
@@ -48,9 +52,9 @@ namespace BlackMisc
//! By default, we use the executables name.
if ((*m_applicationName).isEmpty())
{
char name[1024];
WCHAR name[1024];
int size = GetModuleFileName (NULL, name, 1023);
QString applicationPath = QString::fromUtf8(name,size);
QString applicationPath = QString::fromWCharArray(name,size);
(*m_applicationName) = QFileInfo ( applicationPath ).fileName();
}
#else

19
src/driver/fs9/fs9.pro Normal file
View File

@@ -0,0 +1,19 @@
TARGET = bb_driver_fs9
TEMPLATE = lib
CONFIG += dll
INCLUDEPATH += .. ../../
DESTDIR = ../../../bin
DEPENDPATH += .
HEADERS += \
driver_fs9.h
SOURCES += \
driver_fs9.cpp

19
src/driver/fsx/fsx.pro Normal file
View File

@@ -0,0 +1,19 @@
TARGET = bb_driver_fsx
TEMPLATE = lib
CONFIG += dll
INCLUDEPATH += .. ../../
DESTDIR = ../../../bin
DEPENDPATH += .
HEADERS += \
driver_fsx.h
SOURCES += \
driver_fsx.cpp

View File

@@ -0,0 +1,19 @@
TARGET = bb_driver_xplane
TEMPLATE = lib
CONFIG += dll
INCLUDEPATH += .. ../../
DESTDIR = ../../../bin
DEPENDPATH += .
HEADERS += \
driver_xplane.h
SOURCES += \
driver_xplane.cpp