Cmake build wit qt(5|6)(macos) did not include "plugins"

This makes things much simpler.

But at least with the latest macos tools (Sonoma and XCode15) a bundle
refuses to run if it 's not signed properly.

Both issues are solved with the patch included and have now been tested
with Qt5.15 and Qt6.7.

For completeness: I've checked the font-emph shortcut issue and, as
reported in the ticket mentioned, ^CmdE works with Qt5.15 but not with
Qt6.7. However the sequence ^C E does work. I don't know whether this is
intended as a workaround for this issue or was already implemented.
This commit is contained in:
Patrick de Visschere 2024-03-23 11:25:27 +01:00 committed by Kornel Benko
parent 4dfebbe9da
commit 58aca89003

View File

@ -27,15 +27,25 @@ if(LYX_BUNDLE)
set(qt_conf_path "${LYX_BUNDLE_NAME}.app/Contents/Resources/qt.conf")
endif()
if(Qt5Core_FOUND)
if(${LYX_USE_QT} STREQUAL "QT5")
set(QtScope "Qt5")
elseif(${LYX_USE_QT} STREQUAL "QT6")
set(QtScope "Qt6")
endif()
get_target_property( MyLoc "${QtScope}::QSvgPlugin" LOCATION)
get_filename_component(MyDir ${MyLoc} PATH)
set(QT_PLUGINS_DIR ${MyDir}/..)
set(QT_LIBRARY_DIRS ${QT_PLUGINS_DIR}/../lib)
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")
if(Qt6Core_FOUND OR (Qt5Core_FOUND AND (Qt5Core_VERSION VERSION_GREATER_EQUAL 5.10.0)))
install_qt_plugin("${QtScope}::QMacStylePlugin")
endif()
install_qt_plugin("${QtScope}::QCocoaIntegrationPlugin")
endif()
# Install code does the following:
@ -51,6 +61,12 @@ if(LYX_BUNDLE)
COMPONENT Runtime
)
if(APPLE)
# fixup_bundle invalidates the codesign, so the app must be signed again.
add_custom_target(sign_install WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}
COMMAND /usr/bin/codesign --deep --force --sign "${CPACK_BUNDLE_APPLE_CERT_APP}" "LyX2.4.app" VERBATIM)
endif()
if (APPLE AND LYX_DMG)
# Setup the disk image layout
install(CODE "