diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7da9f36de..be6b4319a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,6 +105,7 @@ if(WIN32)
 set(DATADIR "share")
 endif(WIN32)
 set(SHAREDIR ${DATADIR})
+set(PLUGINDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${APPLICATION_SHORTNAME}/plugins" CACHE STRING "Extra path to look for Qt plugins like for VFS. May be relative to binary.")
 
 #####
 ## handle BUILD_OWNCLOUD_OSX_BUNDLE
diff --git a/config.h.in b/config.h.in
index c645c0be6..2dcf2d6f1 100644
--- a/config.h.in
+++ b/config.h.in
@@ -33,5 +33,6 @@
 
 #cmakedefine SYSCONFDIR "@SYSCONFDIR@"
 #cmakedefine SHAREDIR "@SHAREDIR@"
+#cmakedefine PLUGINDIR "@PLUGINDIR@"
 
 #endif
diff --git a/src/gui/application.cpp b/src/gui/application.cpp
index 90f81d45d..fed5c6388 100644
--- a/src/gui/application.cpp
+++ b/src/gui/application.cpp
@@ -269,6 +269,17 @@ Application::Application(int &argc, char **argv)
     if (!AbstractNetworkJob::httpTimeout)
         AbstractNetworkJob::httpTimeout = cfg.timeout();
 
+#ifdef PLUGINDIR
+    // Setup extra plugin search path
+    QString extraPluginPath = QStringLiteral(PLUGINDIR);
+    if (!extraPluginPath.isEmpty()) {
+        if (QDir::isRelativePath(extraPluginPath))
+            extraPluginPath = QDir(QApplication::applicationDirPath()).filePath(extraPluginPath);
+        qCInfo(lcApplication) << "Adding extra plugin search path:" << extraPluginPath;
+        addLibraryPath(extraPluginPath);
+    }
+#endif
+
     // Check vfs plugins
     if (Theme::instance()->showVirtualFilesOption() && bestAvailableVfsMode() == Vfs::Off) {
         qCWarning(lcApplication) << "Theme wants to show vfs mode, but no vfs plugins are available";
diff --git a/src/libsync/vfs/suffix/CMakeLists.txt b/src/libsync/vfs/suffix/CMakeLists.txt
index d98347d50..28699dccf 100644
--- a/src/libsync/vfs/suffix/CMakeLists.txt
+++ b/src/libsync/vfs/suffix/CMakeLists.txt
@@ -14,7 +14,7 @@ set_target_properties("${synclib_NAME}_vfs_suffix" PROPERTIES
 )
 
 INSTALL(TARGETS "${synclib_NAME}_vfs_suffix"
-  LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/plugins"
-  RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}/plugins"
+  LIBRARY DESTINATION "${PLUGINDIR}"
+  RUNTIME DESTINATION "${PLUGINDIR}"
 )