macOS: fix qt plugin installation (#3216)

* Osx: fix qt plugin installation

* Add make install step to travis debug build

* only install under osx

* Add "styles" plugins (for native look'n'feel)

* Osx: upgrade qt from 5.5 to current (5.10.1)

* Fix osx on travis

The qt homebrew formula now installs three qt* symlinks (qt, qt5, qt5@5.x) so we can't use/don't need bash globbing anymore
This commit is contained in:
ctrlaltca 2018-05-02 21:57:35 +02:00 committed by Zach H
parent 8a5baa4637
commit 2780270911
5 changed files with 108 additions and 87 deletions

View file

@ -127,8 +127,8 @@ if(UNIX)
set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
INSTALL(TARGETS servatrice BUNDLE DESTINATION ./)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./Servatrice.app/Contents/Resources/)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./Servatrice.app/Contents/Resources/)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./servatrice.app/Contents/Resources/)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./servatrice.app/Contents/Resources/)
else()
# Assume linux
INSTALL(TARGETS servatrice RUNTIME DESTINATION bin/)
@ -147,14 +147,18 @@ endif()
if(APPLE)
# these needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir Servatrice.app/Contents/Plugins)
set(qtconf_dest_dir Servatrice.app/Contents/Resources)
set(plugin_dest_dir servatrice.app/Contents/Plugins)
set(qtconf_dest_dir servatrice.app/Contents/Resources)
get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/.." ABSOLUTE)
# qt5 plugins: platforms, sqldrivers/mysql
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(platforms/.*|sqldrivers/libqsqlmysql)\\.dylib"
REGEX ".*_debug\\.dylib" EXCLUDE)
FILES_MATCHING
PATTERN "*.dSYM" EXCLUDE
PATTERN "*_debug.dylib" EXCLUDE
PATTERN "platforms/*.dylib"
PATTERN "sqldrivers/libqsqlmysql*.dylib"
)
install(CODE "
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths]
@ -167,7 +171,7 @@ Translations = Resources/translations\")
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dylib\")
set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\")
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\")
" COMPONENT Runtime)
endif()