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