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