[LyX/master] Cmake build: Correct configuration if set LYX_BUNDLE=ON

Kornel Benko kornel at lyx.org
Sat Nov 30 10:11:39 UTC 2019


commit 201acf027911f924ba17da93ce0caa4ec44fc982
Author: Kornel Benko <kornel at lyx.org>
Date:   Sat Nov 30 11:19:10 2019 +0100

    Cmake build: Correct configuration if set LYX_BUNDLE=ON
    
    Patch by Patrick (pdvisschere at edpnet.be)
    Citing:
    With some changes I could get it to work (patch included). One will also
    have to define the locations of the Qt5-plugins and Qt5-libs folders
    (`QT5_PLUGINS_DIR` and `QT5_LIBRARY_DIRS`).
    
    Maybe not all plugins/imageformats are used/needed by lyx, but they are
    all copied now, except for `_debug` versions which are excluded.
    Starting with Qt-5.12 it seems not possible anymore (or at least not
    easy) to link to the `_debug` versions of the qt5-frameworks (with
    cmake). And installing them into the bundle also does not work. So right
    now this is not a big loss.
---
 development/cmake/post_install/CMakeLists.txt |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/development/cmake/post_install/CMakeLists.txt b/development/cmake/post_install/CMakeLists.txt
index 7e4cb64..f0eea84 100644
--- a/development/cmake/post_install/CMakeLists.txt
+++ b/development/cmake/post_install/CMakeLists.txt
@@ -28,13 +28,15 @@ if(LYX_BUNDLE)
     endif()
 
     if(Qt5Core_FOUND)
-        install_qt_plugin("Qt5::QJpegPlugin")
-        install_qt_plugin("Qt5::QGifPlugin")
-        install_qt_plugin("Qt5::QICOPlugin")
-        if(APPLE)
-            install_qt_plugin("Qt5::QCocoaIntegrationPlugin")
-        endif()
-    else()
+	file(GLOB QT_PLUGIN_DIRECTORIES "${QT_PLUGINS_DIR}/imageformats")
+	install(DIRECTORY ${QT_PLUGIN_DIRECTORIES} DESTINATION "${qtplugin_dest_dir}/plugins/" COMPONENT Runtime REGEX "\\_debug\\.dylib$" EXCLUDE)
+       if(APPLE)
+		if(Qt5Core_VERSION VERSION_GREATER_EQUAL 5.10.0)
+       			install_qt_plugin("Qt5::QMacStylePlugin")
+       		endif()
+        install_qt_plugin("Qt5::QCocoaIntegrationPlugin")
+       endif()
+   else()
         # With QT4, just copy all the plugins
         file(GLOB QT_PLUGIN_DIRECTORIES "${QT_PLUGINS_DIR}/*")
         install(DIRECTORY ${QT_PLUGIN_DIRECTORIES} DESTINATION "${qtplugin_dest_dir}/plugins/" COMPONENT Runtime)
@@ -45,7 +47,7 @@ if(LYX_BUNDLE)
     # - install the platform specific plugins (with Qt5)
     # - Fixup the bundle
     install(CODE "include(BundleUtilities)
-                    file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qt_conf_path}\" \"\")
+                    file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qt_conf_path}\" \"[Paths]\\rPlugins = PlugIns\\rTranslations = translations\")
                     file(GLOB_RECURSE QTPLUGINS
                     \"\${CMAKE_INSTALL_PREFIX}/${qtplugin_dest_dir}/plugins/*/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
                     message(STATUS \"QT plugins [\${CMAKE_INSTALL_PREFIX}/${qtplugin_dest_dir}/plugins/*/*${CMAKE_SHARED_LIBRARY_SUFFIX}]: \${QTPLUGINS}\")


More information about the lyx-cvs mailing list