-
Notifications
You must be signed in to change notification settings - Fork 663
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the path should be relative to the binary? or at least allow it.
src/gui/application.cpp
Outdated
@@ -254,6 +254,15 @@ Application::Application(int &argc, char **argv) | |||
AbstractNetworkJob::httpTimeout = cfg.timeout(); | |||
|
|||
// Check vfs plugins | |||
#define MACRO_TO_STRING2(x) #x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe ifdef OC_EXTRA_PLUGIN_PATH, and only add the -D if it is set
CMakeLists.txt
Outdated
@@ -102,6 +102,9 @@ if(NO_MSG_HANDLER) | |||
add_definitions(-DNO_MSG_HANDLER=1) | |||
endif() | |||
|
|||
set(OC_EXTRA_PLUGIN_PATH "" CACHE STRING "Extra path to look for Qt plugins") | |||
add_definitions(-DOC_EXTRA_PLUGIN_PATH=${OC_EXTRA_PLUGIN_PATH}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do it like this. If you absolutely want to use -D instead of putting it in a config.h file, then only apply it to the relevant target not to all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably also define a sane default that just works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make these changes. What default value would you suggest? /usr/lib/owncloud-client
? I imagine it might be different per distro.
@ogoffart I think for most linux packaging we'd want an absolute path. But I'll also allow relative ones, could be useful for osx bundles. |
89359c9
to
f837915
Compare
updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could that be relative to our LIBDIR, so if LIBDIR is /opt/ownCloud/ownCloud/lib/x86_64-linux-gnu/
it would become /opt/ownCloud/ownCloud/lib/x86_64-linux-gnu/plugins ?
@jnweiger I have set the default to |
f837915
to
97bc564
Compare
Isn't If it's indeed correct I think this is ok. A different possibly simpler approach would be to use https://cmake.org/cmake/help/v3.7/module/GNUInstallDirs.html#command:gnuinstalldirs_get_absolute_install_dir basically something around these lines:
And then add |
@dschmidt Yes, the relative path support is relative to the current location of the executable file, meaning the current default isn't useful since CMAKE_INSTALL_LIBDIR is a relative path. I'll fix by using CMAKE_INSTALL_FULL_LIBDIR for the default. |
@dschmidt Should we change this path and the default plugin install path to LIBDIR/owncloud-client/plugins? Then the default config would install and search them in something like /usr/local/lib/x86_64-linux-gnu/owncloud-client/plugins which seems nicer than without the extra owncloud-client/ subfolder. |
0d4ff5d
to
150d2aa
Compare
By default, plugins are only searched next to the binary or next to the other Qt plugins. This optional build variable allows another path to be configured. The idea is that on linux the oC packaging probably wants the binary in something like /opt/owncloud/bin and the plugins in /opt/owncloud/lib/plugins. Similarly, distribution packagers probably don't want the plugins next to the binary or next to the other Qt plugins. This flag allows them to configure another path that the executable will look in.
150d2aa
to
29e57cf
Compare
By default, plugins are only searched next to the binary or next to the
other Qt plugins. This optional build variable allows another path to be
configured.
The idea is that on linux the oC packaging probably wants the binary in
something like /opt/owncloud/bin and the plugins in
/opt/owncloud/lib/plugins.
Similarly, distribution packagers probably don't want the plugins next
to the binary or next to the other Qt plugins. This flag allows them to
configure another path that the executable will look in.
For #7027