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