CQtDeployer/Deploy/deployutils.h

147 lines
4.8 KiB
C
Raw Normal View History

2019-01-26 07:54:56 +03:00
/*
* Copyright (C) 2018-2019 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
2018-12-09 17:35:07 +03:00
#ifndef DEPLOYUTILS_H
#define DEPLOYUTILS_H
#include <QStringList>
2018-12-15 20:51:25 +03:00
#include <QDebug>
2019-01-27 15:37:19 +03:00
#include "deploy_global.h"
2019-03-28 10:32:46 +03:00
enum MSVCVersion: int {
MSVC_Unknown = 0x0,
MSVC_x64 = 0x01,
MSVC_x32 = 0x02,
MSVC_13 = 0x10,
MSVC_15 = 0x20,
MSVC_17 = 0x40,
MSVC_19 = 0x80,
};
2019-01-27 15:37:19 +03:00
struct DEPLOYSHARED_EXPORT QtModuleEntry {
quint64 module;
const char *option;
const char *libraryName;
const char *translation;
};
2018-12-09 17:35:07 +03:00
2019-03-25 20:13:30 +03:00
enum Platform {
UnknownPlatform = 0x0,
Win32,
Win64,
Unix32,
Unix64
};
2019-08-24 17:56:42 +03:00
enum LibPriority : int {
2019-04-04 18:11:38 +03:00
QtLib = 0x0,
2019-03-25 21:27:26 +03:00
ExtraLib,
2019-04-04 18:11:38 +03:00
SystemLib,
NotFile = 0xF,
2019-03-25 21:27:26 +03:00
};
2019-08-24 17:56:42 +03:00
enum class RunMode: int {
Info,
Deploy,
Clear
};
2018-12-15 20:51:25 +03:00
class Deploy;
2018-12-09 17:35:07 +03:00
2019-01-27 15:37:19 +03:00
class DEPLOYSHARED_EXPORT DeployUtils
2018-12-09 17:35:07 +03:00
{
2019-01-27 15:37:19 +03:00
2019-03-28 12:36:21 +03:00
private:
static QString getMSVCName(MSVCVersion msvc);
static QString getMSVCVersion(MSVCVersion msvc);
2019-08-24 17:56:42 +03:00
static bool parseQtDeployMode(Deploy *deploy);
static bool parseQtInfoMode();
static bool parseQtClearMode(Deploy *deploy);
2018-12-09 17:35:07 +03:00
public:
2019-01-27 15:37:19 +03:00
enum QtModule : quint64
{
QtBluetoothModule = 0x0000000000000001,
QtConcurrentModule = 0x0000000000000002,
QtCoreModule = 0x0000000000000004,
QtDeclarativeModule = 0x0000000000000008,
QtDesignerComponents = 0x0000000000000010,
QtDesignerModule = 0x0000000000000020,
QtGuiModule = 0x0000000000000040,
QtHelpModule = 0x0000000000000080,
QtMultimediaModule = 0x0000000000000100,
QtMultimediaWidgetsModule = 0x0000000000000200,
QtMultimediaQuickModule = 0x0000000000000400,
QtNetworkModule = 0x0000000000000800,
QtNfcModule = 0x0000000000001000,
QtOpenGLModule = 0x0000000000002000,
QtPositioningModule = 0x0000000000004000,
QtPrintSupportModule = 0x0000000000008000,
QtQmlModule = 0x0000000000010000,
QtQuickModule = 0x0000000000020000,
QtQuickParticlesModule = 0x0000000000040000,
QtScriptModule = 0x0000000000080000,
QtScriptToolsModule = 0x0000000000100000,
QtSensorsModule = 0x0000000000200000,
QtSerialPortModule = 0x0000000000400000,
QtSqlModule = 0x0000000000800000,
QtSvgModule = 0x0000000001000000,
QtTestModule = 0x0000000002000000,
QtWidgetsModule = 0x0000000004000000,
QtWinExtrasModule = 0x0000000008000000,
QtXmlModule = 0x0000000010000000,
QtXmlPatternsModule = 0x0000000020000000,
QtWebKitModule = 0x0000000040000000,
QtWebKitWidgetsModule = 0x0000000080000000,
QtQuickWidgetsModule = 0x0000000100000000,
QtWebSocketsModule = 0x0000000200000000,
QtEnginioModule = 0x0000000400000000,
QtWebEngineCoreModule = 0x0000000800000000,
QtWebEngineModule = 0x0000001000000000,
QtWebEngineWidgetsModule = 0x0000002000000000,
QtQmlToolingModule = 0x0000004000000000,
Qt3DCoreModule = 0x0000008000000000,
Qt3DRendererModule = 0x0000010000000000,
Qt3DQuickModule = 0x0000020000000000,
Qt3DQuickRendererModule = 0x0000040000000000,
Qt3DInputModule = 0x0000080000000000,
QtLocationModule = 0x0000100000000000,
QtWebChannelModule = 0x0000200000000000,
QtTextToSpeechModule = 0x0000400000000000,
QtSerialBusModule = 0x0000800000000000,
QtGamePadModule = 0x0001000000000000,
Qt3DAnimationModule = 0x0002000000000000,
QtWebViewModule = 0x0004000000000000,
Qt3DExtrasModule = 0x0008000000000000
};
2018-12-15 20:51:25 +03:00
DeployUtils() = delete;
2018-12-09 17:35:07 +03:00
static QString qtDir;
static QStringList extraPaths;
2019-01-27 15:37:19 +03:00
static QtModuleEntry qtModuleEntries[];
2018-12-09 17:35:07 +03:00
2019-03-28 10:32:46 +03:00
static MSVCVersion getMSVC(const QString & _qmake);
static QString getVCredist(const QString & _qmake);
2018-12-09 17:35:07 +03:00
static bool isQtLib(const QString &lib);
static bool isExtraLib(const QString &lib);
2019-08-24 17:56:42 +03:00
static LibPriority getLibPriority(const QString &lib);
2018-12-15 20:51:25 +03:00
static void verboseLog(const QString &str);
2019-08-24 17:56:42 +03:00
static RunMode getMode();
2018-12-15 20:51:25 +03:00
static void help();
static bool parseQt(Deploy *deploy);
2019-01-27 15:37:19 +03:00
static QStringList extractTranslation(const QStringList& libs);
2019-08-12 18:05:28 +03:00
static QString getAppVersion();
static QString getQtVersion();
static void printVersion();
2019-01-27 15:37:19 +03:00
2018-12-09 17:35:07 +03:00
};
#endif // DEPLOYUTILS_H