From 8ffe0bc0a45bf14afe659d8b9af79c7b45f665bc Mon Sep 17 00:00:00 2001 From: polos Date: Wed, 4 Oct 2017 07:58:47 +0200 Subject: [PATCH] change modules from 'dll' to 'plugin'; macOS: search plugin in bundle; --- src/ecl_fun.cpp | 17 +++++++++++++---- src/eql.cpp | 2 +- src/module_help.pro | 2 +- src/module_multimedia.pro | 2 +- src/module_network.pro | 2 +- src/module_quick.pro | 2 +- src/module_sql.pro | 2 +- src/module_svg.pro | 2 +- src/module_webengine.pro | 2 +- src/module_webkit.pro | 2 +- 10 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/ecl_fun.cpp b/src/ecl_fun.cpp index 01528a1..13792ee 100644 --- a/src/ecl_fun.cpp +++ b/src/ecl_fun.cpp @@ -2434,10 +2434,19 @@ cl_object qrequire2(cl_object l_name, cl_object l_quiet) { /// qrequire ecl_process_env()->nvalues = 1; QString name = symbolName(l_name); QString fileName = "eql5_" + name; - QLibrary lib(fileName); // global library - if(!lib.load()) { - fileName.prepend("/usr/local/lib/"); // "local" might not be in library search path - lib.setFileName(fileName); } + QLibrary lib(fileName); + QStringList libPaths = QCoreApplication::libraryPaths(); +#ifdef Q_OS_MACOS + // try bundle first + QString appPath(QCoreApplication::applicationDirPath()); + if(appPath.contains(".app/") { + libPaths.prepend(appPath + "/../libs")); } + else { + libPaths.prepend("/usr/local/lib"); } +#else + libPaths.prepend("/usr/local/lib"); +#endif + QCoreApplication::setLibraryPaths(libPaths); typedef void (*Ini)(); Ini ini = (Ini)lib.resolve("ini"); if(ini) { diff --git a/src/eql.cpp b/src/eql.cpp index 9ea4a31..6463e6f 100644 --- a/src/eql.cpp +++ b/src/eql.cpp @@ -7,7 +7,7 @@ #include #include -const char EQL::version[] = "17.9.1"; // September 2017 +const char EQL::version[] = "17.10.1"; // October 2017 extern "C" void ini_EQL(cl_object); diff --git a/src/module_help.pro b/src/module_help.pro index 979d26b..d696dfb 100644 --- a/src/module_help.pro +++ b/src/module_help.pro @@ -1,6 +1,6 @@ QT += help printsupport uitools TEMPLATE = lib -CONFIG += dll no_keywords release +CONFIG += plugin no_keywords release INCLUDEPATH += ../src /usr/local/include LIBS += -lecl -leql5 -L.. -L/usr/local/lib TARGET = eql5_help diff --git a/src/module_multimedia.pro b/src/module_multimedia.pro index 9a0a636..6f3d2d6 100644 --- a/src/module_multimedia.pro +++ b/src/module_multimedia.pro @@ -1,6 +1,6 @@ QT += multimedia multimediawidgets printsupport uitools TEMPLATE = lib -CONFIG += dll no_keywords release +CONFIG += plugin no_keywords release INCLUDEPATH += ../src /usr/local/include LIBS += -lecl -leql5 -L.. -L/usr/local/lib TARGET = eql5_multimedia diff --git a/src/module_network.pro b/src/module_network.pro index 73d8637..6ed8311 100644 --- a/src/module_network.pro +++ b/src/module_network.pro @@ -1,6 +1,6 @@ QT += network printsupport uitools TEMPLATE = lib -CONFIG += dll no_keywords release +CONFIG += plugin no_keywords release INCLUDEPATH += ../src /usr/local/include LIBS += -lecl -leql5 -L.. -L/usr/local/lib TARGET = eql5_network diff --git a/src/module_quick.pro b/src/module_quick.pro index db63ff9..be953bc 100644 --- a/src/module_quick.pro +++ b/src/module_quick.pro @@ -1,6 +1,6 @@ QT += quick quickwidgets qml printsupport uitools TEMPLATE = lib -CONFIG += dll no_keywords release +CONFIG += plugin no_keywords release INCLUDEPATH += ../src /usr/local/include LIBS += -lecl -leql5 -L.. -L/usr/local/lib TARGET = eql5_quick diff --git a/src/module_sql.pro b/src/module_sql.pro index 8fce33f..8c5aa92 100644 --- a/src/module_sql.pro +++ b/src/module_sql.pro @@ -1,6 +1,6 @@ QT += sql printsupport uitools TEMPLATE = lib -CONFIG += dll no_keywords release +CONFIG += plugin no_keywords release INCLUDEPATH += ../src /usr/local/include LIBS += -lecl -leql5 -L.. -L/usr/local/lib TARGET = eql5_sql diff --git a/src/module_svg.pro b/src/module_svg.pro index 82ed2ad..d27f901 100644 --- a/src/module_svg.pro +++ b/src/module_svg.pro @@ -1,6 +1,6 @@ QT += svg printsupport uitools TEMPLATE = lib -CONFIG += dll no_keywords release +CONFIG += plugin no_keywords release INCLUDEPATH += ../src /usr/local/include LIBS += -lecl -leql5 -L.. -L/usr/local/lib TARGET = eql5_svg diff --git a/src/module_webengine.pro b/src/module_webengine.pro index 9396043..ee78107 100644 --- a/src/module_webengine.pro +++ b/src/module_webengine.pro @@ -1,6 +1,6 @@ QT += webenginewidgets printsupport uitools TEMPLATE = lib -CONFIG += dll no_keywords release +CONFIG += plugin no_keywords release INCLUDEPATH += ../src /usr/local/include LIBS += -lecl -leql5 -L.. -L/usr/local/lib TARGET = eql5_webengine diff --git a/src/module_webkit.pro b/src/module_webkit.pro index c19dd3f..b67f604 100644 --- a/src/module_webkit.pro +++ b/src/module_webkit.pro @@ -1,6 +1,6 @@ QT += webkitwidgets printsupport uitools TEMPLATE = lib -CONFIG += dll no_keywords release +CONFIG += plugin no_keywords release INCLUDEPATH += ../src /usr/local/include LIBS += -lecl -leql5 -L.. -L/usr/local/lib TARGET = eql5_webkit