set(qt_conf_path "${LYX_BUNDLE_NAME}.app/Contents/Resources/qt.conf")
endif()
- if(Qt5Core_FOUND)
- 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(${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(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:
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}\")
- fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${installed_lyx_path}\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIRS}\")"
+ fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${installed_lyx_path}\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIRS}\")"
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 "
message(STATUS \"Creating the folder view options (.DS_Store)\")
execute_process(COMMAND /bin/ln -sf /Applications \"\${CMAKE_INSTALL_PREFIX}\")
- execute_process(COMMAND /bin/bash \"${CMAKE_CURRENT_SOURCE_DIR}/../../MacOSX/set_bundle_display_options.sh\"
+ execute_process(COMMAND /bin/bash \"${CMAKE_CURRENT_SOURCE_DIR}/../../MacOSX/set_bundle_display_options.sh\"
\"${CMAKE_BINARY_DIR}/ds_store\" \"${_lyx}\" \"${TOP_CMAKE_PATH}/../MacOSX/dmg-background.png\" 560 364)
")
endif()