diff --git a/CMakeLists.txt b/CMakeLists.txt index 52c5be6938d..4d7667b04ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,7 @@ if(WIN32) set(DATADIR "share") endif(WIN32) set(SHAREDIR ${DATADIR}) +set(PLUGINDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME}/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 68143d94357..2cddd8f6c0f 100644 --- a/config.h.in +++ b/config.h.in @@ -25,5 +25,6 @@ #cmakedefine SYSCONFDIR "@SYSCONFDIR@" #cmakedefine SHAREDIR "@SHAREDIR@" +#cmakedefine PLUGINDIR "@PLUGINDIR@" #endif diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 91d44dc4666..913eff61eb8 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -253,6 +253,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 d98347d5043..28699dccfab 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}" )