##// END OF EJS Templates
Fixes compilation
Alexandre Leroux -
r253:3d38308de2ed
parent child
Show More
@@ -1,74 +1,76
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 <Plugin/PluginManager.h>
28 #include <Plugin/PluginManager.h>
29 #include <QDir>
29 #include <QDir>
30
30
31 namespace {
31 namespace {
32
32
33 /// Name of the directory containing the plugins
33 /// Name of the directory containing the plugins
34
34
35 #if _WIN32 || _WIN64
35 #if _WIN32 || _WIN64
36 const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins");
36 const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins");
37 #endif
37 #endif
38
38
39 } // namespace
39 } // namespace
40
40
41 int main(int argc, char *argv[])
41 int main(int argc, char *argv[])
42 {
42 {
43 SqpApplication a{argc, argv};
43 SqpApplication a{argc, argv};
44 SqpApplication::setOrganizationName("LPP");
44 SqpApplication::setOrganizationName("LPP");
45 SqpApplication::setOrganizationDomain("lpp.fr");
45 SqpApplication::setOrganizationDomain("lpp.fr");
46 SqpApplication::setApplicationName("SciQLop");
46 SqpApplication::setApplicationName("SciQLop");
47 MainWindow w;
47 MainWindow w;
48 w.show();
48 w.show();
49
49
50 // Loads plugins
50 // Loads plugins
51 auto pluginDir = QDir{sqpApp->applicationDirPath()};
51 auto pluginDir = QDir{sqpApp->applicationDirPath()};
52 #if _WIN32 || _WIN64
52 #if _WIN32 || _WIN64
53 pluginDir.mkdir(PLUGIN_DIRECTORY_NAME);
53 pluginDir.mkdir(PLUGIN_DIRECTORY_NAME);
54 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
54 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
55 #endif
55 #endif
56
56
57
57
58 #if __GNUC__
58 #if __GNUC__
59 #if __x86_64__ || __ppc64__
59 #if __x86_64__ || __ppc64__
60 if (!pluginDir.cd("../lib64/SciQlop")) {
60 if (!pluginDir.cd("../lib64/SciQlop")) {
61 pluginDir.cd("../lib64/sciqlop");
61 pluginDir.cd("../lib64/sciqlop");
62 }
62 }
63 #else
63 #else
64 __x86_64__ || __ppc64__ if (!pluginDir.cd("../lib/SciQlop")) { pluginDir.cd("../lib/sciqlop"); }
64 if (!pluginDir.cd("../lib/SciQlop")) {
65 pluginDir.cd("../lib/sciqlop");
66 }
65 #endif
67 #endif
66 #endif
68 #endif
67 qCDebug(LOG_PluginManager())
69 qCDebug(LOG_PluginManager())
68 << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath());
70 << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath());
69
71
70 PluginManager pluginManager{};
72 PluginManager pluginManager{};
71 pluginManager.loadPlugins(pluginDir);
73 pluginManager.loadPlugins(pluginDir);
72
74
73 return a.exec();
75 return a.exec();
74 }
76 }
General Comments 0
You need to be logged in to leave comments. Login now