changeset 1781:008e413f6aaf

Update helper dir path to look in equivalent of /usr/lib/xxxx on Linux
author Chris Cannam
date Mon, 16 Sep 2019 14:23:17 +0100
parents 6d6740b075c3
children 2a810ed46977
files base/HelperExecPath.cpp
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/base/HelperExecPath.cpp	Thu Sep 12 11:52:19 2019 +0100
+++ b/base/HelperExecPath.cpp	Mon Sep 16 14:23:17 2019 +0100
@@ -58,15 +58,27 @@
 QStringList
 HelperExecPath::getHelperDirPaths()
 {
-    // Helpers are expected to exist either in the same directory as
-    // this executable was found, or in either a subdirectory called
-    // helpers, or on the Mac only, a sibling called Resources.
+    // Helpers are expected to exist in one of the following, in order
+    // from most strongly preferred to least:
+    //
+    // 1. (on Mac only) in <mydir>/../Resources
+    //
+    // 2. (on non-Windows non-Mac platforms only) in
+    // <mydir>/../lib/application-name/
+    //
+    // 3. (on non-Mac platforms only) in <mydir>/helpers
+    //
+    // 4. in <mydir>
 
     QStringList dirs;
+    QString appName = QCoreApplication::applicationName();
     QString myDir = QCoreApplication::applicationDirPath();
 #ifdef Q_OS_MAC
     dirs.push_back(myDir + "/../Resources");
 #else
+#ifndef Q_OS_WIN32
+    dirs.push_back(myDir + "/../lib/" + appName);
+#endif
     dirs.push_back(myDir + "/helpers");
 #endif
     dirs.push_back(myDir);