@@ -1,93 +1,93 | |||
|
1 | 1 | /*------------------------------------------------------------------------------ |
|
2 | 2 | -- This file is a part of the QLop Software |
|
3 | 3 | -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS |
|
4 | 4 | -- |
|
5 | 5 | -- This program is free software; you can redistribute it and/or modify |
|
6 | 6 | -- it under the terms of the GNU General Public License as published by |
|
7 | 7 | -- the Free Software Foundation; either version 2 of the License, or |
|
8 | 8 | -- (at your option) any later version. |
|
9 | 9 | -- |
|
10 | 10 | -- This program is distributed in the hope that it will be useful, |
|
11 | 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 | 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 | 13 | -- GNU General Public License for more details. |
|
14 | 14 | -- |
|
15 | 15 | -- You should have received a copy of the GNU General Public License |
|
16 | 16 | -- along with this program; if not, write to the Free Software |
|
17 | 17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 | 18 | -------------------------------------------------------------------------------*/ |
|
19 | 19 | /*-- Author : Alexis Jeandet |
|
20 | 20 | -- Mail : alexis.jeandet@member.fsf.org |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #include "MainWindow.h" |
|
23 | 23 | #include <QProcessEnvironment> |
|
24 | 24 | #include <QThread> |
|
25 | 25 | #include <SqpApplication.h> |
|
26 | 26 | #include <qglobal.h> |
|
27 | 27 | |
|
28 | 28 | #include <PluginManager/PluginManager.h> |
|
29 | 29 | #include <QDir> |
|
30 | 30 | #include <QtPlugin> |
|
31 | 31 | |
|
32 | 32 | #include <QLoggingCategory> |
|
33 | 33 | |
|
34 | 34 | Q_LOGGING_CATEGORY(LOG_Main, "Main") |
|
35 | 35 | |
|
36 | 36 | namespace |
|
37 | 37 | { |
|
38 | 38 | |
|
39 | 39 | const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins"); |
|
40 | 40 | |
|
41 | 41 | |
|
42 | 42 | } // namespace |
|
43 | 43 | |
|
44 | 44 | int main(int argc, char* argv[]) |
|
45 | 45 | { |
|
46 | 46 | #ifdef QT_STATICPLUGIN |
|
47 | 47 | Q_IMPORT_PLUGIN(MockPlugin) |
|
48 | 48 | Q_IMPORT_PLUGIN(AmdaPlugin) |
|
49 | 49 | Q_INIT_RESOURCE(amdaresources); |
|
50 | 50 | #endif |
|
51 | 51 | Q_INIT_RESOURCE(sqpguiresources); |
|
52 | 52 | |
|
53 | 53 | SqpApplication::setOrganizationName("LPP"); |
|
54 | 54 | SqpApplication::setOrganizationDomain("lpp.fr"); |
|
55 | 55 | SqpApplication::setApplicationName("SciQLop"); |
|
56 | 56 | |
|
57 | 57 | QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); |
|
58 | 58 | |
|
59 | 59 | SqpApplication a { argc, argv }; |
|
60 | 60 | |
|
61 | 61 | MainWindow w; |
|
62 | 62 | w.show(); |
|
63 | 63 | |
|
64 | 64 | // Loads plugins |
|
65 | 65 | auto pluginDir = QDir { a.applicationDirPath() }; |
|
66 | 66 | auto pluginLookupPath = { |
|
67 |
a.applicationDirPath() + "/../lib64/SciQ |
|
|
67 | a.applicationDirPath() + "/../lib64/SciQLop", | |
|
68 | 68 | a.applicationDirPath() + "/../lib64/sciqlop", |
|
69 |
a.applicationDirPath() + "/../lib/SciQ |
|
|
69 | a.applicationDirPath() + "/../lib/SciQLop", | |
|
70 | 70 | a.applicationDirPath() + "/../lib/sciqlop", |
|
71 | 71 | }; |
|
72 | 72 | |
|
73 | 73 | #if _WIN32 || _WIN64 |
|
74 | 74 | pluginDir.mkdir(PLUGIN_DIRECTORY_NAME); |
|
75 | 75 | pluginDir.cd(PLUGIN_DIRECTORY_NAME); |
|
76 | 76 | #endif |
|
77 | 77 | |
|
78 | 78 | PluginManager pluginManager {}; |
|
79 | 79 | |
|
80 | 80 | for (auto&& path : pluginLookupPath) |
|
81 | 81 | { |
|
82 | 82 | QDir directory { path }; |
|
83 | 83 | if (directory.exists()) |
|
84 | 84 | { |
|
85 | 85 | qCDebug(LOG_Main()) |
|
86 | 86 | << QObject::tr("Plugin directory: %1").arg(directory.absolutePath()); |
|
87 | 87 | pluginManager.loadPlugins(directory); |
|
88 | 88 | } |
|
89 | 89 | } |
|
90 | 90 | pluginManager.loadStaticPlugins(); |
|
91 | 91 | |
|
92 | 92 | return a.exec(); |
|
93 | 93 | } |
@@ -1,10 +1,10 | |||
|
1 | 1 | #!/bin/bash |
|
2 | 2 | mkdir build |
|
3 | 3 | cd build |
|
4 | 4 | meson --prefix=/usr .. |
|
5 | 5 | ninja |
|
6 | 6 | DESTDIR=AppDir ninja install |
|
7 | 7 | mv AppDir/usr/lib64 AppDir/usr/lib |
|
8 | 8 | wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage |
|
9 | 9 | chmod +x linuxdeployqt-continuous-x86_64.AppImage && ./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract |
|
10 |
LD_LIBRARY_PATH=AppDir/usr/lib |
|
|
10 | LD_LIBRARY_PATH=AppDir/usr/lib/ ./squashfs-root/AppRun AppDir/usr/share/applications/*.desktop -appimage |
General Comments 0
You need to be logged in to leave comments.
Login now