macOS: Fix vfs suffix plugin paths #7090

This commit is contained in:
Markus Goetz 2019-03-15 13:56:11 +01:00
parent fc90adf469
commit 626ea031ec
3 changed files with 26 additions and 3 deletions

View File

@ -69,7 +69,13 @@ 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.")
if (NOT APPLE)
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.")
else()
# Inside the .app bundle
set(PLUGINDIR "../PlugIns" CACHE STRING "Extra path to look for Qt plugins like for VFS. May be relative to binary.")
endif()
#####
## handle BUILD_OWNCLOUD_OSX_BUNDLE

View File

@ -405,6 +405,9 @@ if LooseVersion(qt_version) >= LooseVersion("5.10.0"):
for plugin in QT_PLUGINS:
FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin))
# The FixPlugin function is actually for Qt plugins, but for now we abuse it for our own plugin
FixPlugin(bundle_dir+'/Contents/PlugIns/owncloudsync_vfs_suffix.dylib', '')
if LooseVersion(qt_version) >= LooseVersion("5.10.0"):
args = ['plutil', '-insert', 'LSMinimumSystemVersion', '-string', '10.10.0', os.path.join(bundle_dir, 'Contents', 'Info.plist')]
commands.append(args)

View File

@ -13,8 +13,22 @@ set_target_properties("${synclib_NAME}_vfs_suffix" PROPERTIES
AUTOMOC TRUE
)
if(APPLE)
# for being loadable when client run from build dir
set(vfs_buildoutputdir "${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns/")
set_target_properties("${synclib_NAME}_vfs_suffix"
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${vfs_buildoutputdir}
RUNTIME_OUTPUT_DIRECTORY ${vfs_buildoutputdir}
)
# For being lodable when client run from install dir (after make macdeployqt)
set(vfs_installdir "${LIB_INSTALL_DIR}/../PlugIns")
else()
set(vfs_installdir "${PLUGINDIR}")
endif()
INSTALL(TARGETS "${synclib_NAME}_vfs_suffix"
LIBRARY DESTINATION "${PLUGINDIR}"
RUNTIME DESTINATION "${PLUGINDIR}"
LIBRARY DESTINATION "${vfs_installdir}"
RUNTIME DESTINATION "${vfs_installdir}"
)