From a404606925c0f0edbc9cee5e04f48d9a7d490d6b Mon Sep 17 00:00:00 2001
From: Erik Schilling <ablu.erikschilling@googlemail.com>
Date: Sat, 15 Mar 2014 13:32:57 +0100
Subject: [PATCH] Added a USE_FHS_PLUGIN_PATH switch
Setting this variable during the qmake run will make tiled
correctly picking up the install dir of plugins if the
lib path differs from "../lib" (generally the case for 64 bit releases).
---
src/tiled/pluginmanager.cpp | 5 +++++
tiled.pri | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/src/tiled/pluginmanager.cpp b/src/tiled/pluginmanager.cpp
index 7755d42..078fa84 100644
--- a/src/tiled/pluginmanager.cpp
+++ b/src/tiled/pluginmanager.cpp
@@ -62,11 +62,16 @@ void PluginManager::loadPlugins()
mPlugins.append(Plugin(QLatin1String("<static>"), instance));
// Determine the plugin path based on the application location
+#ifndef TILED_PLUGIN_DIR
QString pluginPath = QCoreApplication::applicationDirPath();
+#endif
+
#ifdef Q_OS_WIN32
pluginPath += QLatin1String("/plugins/tiled");
#elif defined(Q_OS_MAC)
pluginPath += QLatin1String("/../PlugIns");
+#elif defined(TILED_PLUGIN_DIR)
+ QString pluginPath = QLatin1String(TILED_PLUGIN_DIR);
#else
pluginPath += QLatin1String("/../lib/tiled/plugins");
#endif
diff --git a/tiled.pri b/tiled.pri
index 66a6a42..1ec9c8c 100644
--- a/tiled.pri
+++ b/tiled.pri
@@ -10,3 +10,8 @@ macx {
}
CONFIG += depend_includepath
+
+
+!isEmpty(USE_FHS_PLUGIN_PATH) {
+ DEFINES += TILED_PLUGIN_DIR=\\\"$${LIBDIR}/tiled/plugins/\\\"
+}
--
1.8.5.3