##// END OF EJS Templates
Made more consistent plugin install path with CMake, removed useless plugin lookup path...
jeandet -
r1398:728acc3a845d
parent child
Show More
@@ -33,14 +33,15
33 33
34 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 40
40 41
41 42 } // namespace
42 43
43 int main(int argc, char *argv[])
44 int main(int argc, char* argv[])
44 45 {
45 46 #ifdef QT_STATICPLUGIN
46 47 Q_IMPORT_PLUGIN(MockPlugin)
@@ -55,21 +56,18 int main(int argc, char *argv[])
55 56
56 57 QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
57 58
58 SqpApplication a{argc, argv};
59 SqpApplication a { argc, argv };
59 60
60 61 MainWindow w;
61 62 w.show();
62 63
63 64 // Loads plugins
64 auto pluginDir = QDir{a.applicationDirPath()};
65 auto pluginDir = QDir { a.applicationDirPath() };
65 66 auto pluginLookupPath = {
66 a.applicationDirPath(),
67 a.applicationDirPath() + "/" + PLUGIN_DIRECTORY_NAME,
68 67 a.applicationDirPath() + "/../lib64/SciQlop",
69 68 a.applicationDirPath() + "/../lib64/sciqlop",
70 69 a.applicationDirPath() + "/../lib/SciQlop",
71 70 a.applicationDirPath() + "/../lib/sciqlop",
72 a.applicationDirPath() + "/../plugins",
73 71 };
74 72
75 73 #if _WIN32 || _WIN64
@@ -77,11 +75,13 int main(int argc, char *argv[])
77 75 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
78 76 #endif
79 77
80 PluginManager pluginManager{};
78 PluginManager pluginManager {};
81 79
82 for (auto &&path : pluginLookupPath) {
83 QDir directory{path};
84 if (directory.exists()) {
80 for (auto&& path : pluginLookupPath)
81 {
82 QDir directory { path };
83 if (directory.exists())
84 {
85 85 qCDebug(LOG_Main())
86 86 << QObject::tr("Plugin directory: %1").arg(directory.absolutePath());
87 87 pluginManager.loadPlugins(directory);
@@ -30,7 +30,7 target_link_libraries(amdaplugin PUBLIC sciqlopgui)
30 30 install(TARGETS amdaplugin
31 31 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
32 32 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
33 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
33 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/SciQlop)
34 34
35 35 include(sciqlop_tests)
36 36
@@ -19,7 +19,7 target_link_libraries(mockplugin sciqlopgui)
19 19 install(TARGETS mockplugin
20 20 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
21 21 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
22 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
22 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/SciQlop)
23 23
24 24 include(sciqlop_tests)
25 25
General Comments 0
You need to be logged in to leave comments. Login now