Files
pilotclient/samples/blackmiscsim/main.cpp
Roland Winklmeier a3bc5c2936 Add <swiftInstall>/bin to library lookup paths
Summary:
This change adds <swiftInstall>/bin to the library lookup paths.
Without, QFactoryLoader is not able to find the Qt plugins
on Mac OS since on this platform the hard coded path defaults to
'foo.app/Contents/MacOS' for app bundles.
This change also adds the installation of QtPrintSupport framework which
is a dependency from cocoa platform plugin.

ref T48

Reviewers: kbasan, msutcliffe

Reviewed By: kbasan

Subscribers: jenkins

Maniphest Tasks: T48

Differential Revision: https://dev.swift-project.org/D15
2017-05-05 22:40:43 +01:00

81 lines
2.2 KiB
C++

/* Copyright (C) 2014
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
//! \ingroup sampleblackmiscsim
#include "samplesfscommon.h"
#include "samplesfsx.h"
#include "samplesmodelmapping.h"
#include "samplesvpilotrules.h"
#include "blackcore/application.h"
#include "blackmisc/directoryutils.h"
#include <stdio.h>
#include <stdlib.h>
#include <QCoreApplication>
#include <QString>
#include <QTextStream>
#include <QTime>
#include <QtGlobal>
using namespace BlackMisc;
//! main
int main(int argc, char *argv[])
{
#ifdef Q_OS_MAC
QCoreApplication::addLibraryPath(CDirectoryUtils::applicationDirectoryPath());
#endif
QCoreApplication qa(argc, argv);
BlackCore::CApplication a;
Q_UNUSED(a);
Q_UNUSED(qa);
QTextStream streamIn(stdin);
QTextStream streamOut(stdout);
streamOut << "Run samples:" << endl;
streamOut << "1 .. FS common / Simulation (with cfg files reading)" << endl;
streamOut << "2 .. FSX" << endl;
streamOut << "3 .. Mappings" << endl;
streamOut << "4 .. vPilot rules" << endl;
streamOut << "x .. exit" << endl;
QString i = streamIn.readLine().toLower().trimmed();
QTime t;
t.start();
if (i.startsWith("1"))
{
BlackSample::CSamplesFsCommon::samples(streamOut, streamIn);
}
else if (i.startsWith("2"))
{
BlackSample::CSamplesFsx::samplesMisc(streamOut);
}
else if (i.startsWith("3"))
{
BlackSample::CSamplesModelMapping::samples(streamOut, streamIn);
}
else if (i.startsWith("4"))
{
BlackSample::CSamplesVPilotRules::samples(streamOut, streamIn);
}
else if (i.startsWith("x"))
{
streamOut << "terminating" << endl;
}
streamOut << endl;
streamOut << "time elapsed: " << t.elapsed() << "ms" << endl;
streamOut << "press key to exit" << endl;
streamIn.readLine();
return EXIT_SUCCESS;
}