Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OC_EXTRA_PLUGIN_PATH cmake and define #7076

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,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
Expand Down
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@

#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
#cmakedefine SHAREDIR "@SHAREDIR@"
#cmakedefine PLUGINDIR "@PLUGINDIR@"

#endif
11 changes: 11 additions & 0 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions src/libsync/vfs/suffix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)