From 6b80cc0372961e528a238e0599b74b1a4c0bbacf Mon Sep 17 00:00:00 2001 From: Kathleen Biagas Date: Tue, 9 Apr 2024 16:09:03 -0700 Subject: [PATCH] Install more qt plugins. (#19427) * Install more qt plugins. Add 'tls', 'imageformats', 'iconengines'. Streamlined logic related to plugins. * Test for existence of some plugins before adding them to the list of plugins to install. --- src/CMake/FindVisItQt.cmake | 95 ++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 50 deletions(-) diff --git a/src/CMake/FindVisItQt.cmake b/src/CMake/FindVisItQt.cmake index 47b193feae2..af563d28b0b 100644 --- a/src/CMake/FindVisItQt.cmake +++ b/src/CMake/FindVisItQt.cmake @@ -42,9 +42,13 @@ # Kathleen Biagas, Wed May 10, 2023 # Add support for Qt6. # -# Kathleen Biagas, Wed Dec 16, 20223 +# Kathleen Biagas, Wed Dec 16, 2023 # Add Concurrent to core list of qt modules to ensure it gets installed. # +# Kathleen Biagas, Wed Mar 27, 2024 +# Add 'tls', 'imageformats', 'iconengines' to the plugins. +# Reworked logic related to plugins. +# #***************************************************************************** #[====[ @@ -192,69 +196,60 @@ if(NOT VISIT_QT_SKIP_INSTALL) GROUP_READ GROUP_WRITE WORLD_READ) - # Platform plugins if(WIN32) - install(DIRECTORY ${VISIT_QT_DIR}/plugins/platforms - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/qtplugins) - if(${QT_MAJOR_VERSION} EQUAL 5) - install(DIRECTORY ${VISIT_QT_DIR}/plugins/printsupport - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/qtplugins) - endif() - - # We also need platforms and qt.conf in the build dir. + # We also need plugins and qt.conf in the build dir. file(WRITE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf "[Paths]\nPlugins=../ThirdParty/qtplugins\n") add_custom_target(copy_qt_plugins ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/qt.conf - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${VISIT_QT_DIR}/plugins/platforms - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ThirdParty/qtplugins/platforms) - if(${QT_MAJOR_VERSION} EQUAL 5) - add_custom_command(TARGET copy_qt_plugins - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${VISIT_QT_DIR}/plugins/printsupport - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ThirdParty/qtplugins/printsupport) - endif() - - visit_add_to_util_builds(copy_qt_plugins) - - elseif(APPLE) - install(DIRECTORY ${VISIT_QT_DIR}/plugins/platforms - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/gui.app/Contents/MacOS) - - install(DIRECTORY ${VISIT_QT_DIR}/plugins/platforms - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/viewer.app/Contents/MacOS) - - install(DIRECTORY ${VISIT_QT_DIR}/plugins/platforms - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/xmledit.app/Contents/MacOS) - - install(DIRECTORY ${VISIT_QT_DIR}/plugins/platforms - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/mcurvit.app/Contents/MacOS) - - install(DIRECTORY ${VISIT_QT_DIR}/plugins/styles - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/gui.app/Contents/MacOS) + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/qt.conf) + endif() - install(DIRECTORY ${VISIT_QT_DIR}/plugins/styles - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/viewer.app/Contents/MacOS) - install(DIRECTORY ${VISIT_QT_DIR}/plugins/styles - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/xmledit.app/Contents/MacOS) + # Plugins + set(install_plugins platforms) + foreach(p iconengines imageformats printsupport styles tls) + if(EXISTS ${VISIT_QT_DIR}/plugins/${p}) + list(APPEND install_plugins ${p}) + endif() + endforeach() + if(LINUX) + list(APPEND install_plugins "xcbglintegrations") + endif() - install(DIRECTORY ${VISIT_QT_DIR}/plugins/styles - DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/mcurvit.app/Contents/MacOS) + if(WIN32) + set(plugin_loc ${VISIT_INSTALLED_VERSION_BIN}/qtplugins) else() - install(DIRECTORY ${VISIT_QT_DIR}/plugins/platforms - DESTINATION ${VISIT_INSTALLED_VERSION_LIB}/qtplugins) + set(plugin_loc ${VISIT_INSTALLED_VERSION_LIB}/qtplugins) endif() - if(LINUX) - # Xcb related plugins - install(DIRECTORY ${VISIT_QT_DIR}/plugins/xcbglintegrations - DESTINATION ${VISIT_INSTALLED_VERSION_LIB}/qtplugins) + foreach(p ${install_plugins}) + if(APPLE) + foreach(app gui.app viewer.app xmledit.app mcurvit.app) + install(DIRECTORY ${VISIT_QT_DIR}/plugins/${p} + DESTINATION ${VISIT_INSTALLED_VERSION_BIN}/${app}/Contents/MacOS) + endforeach() + else() + install(DIRECTORY ${VISIT_QT_DIR}/plugins/${p} + DESTINATION ${plugin_loc}) + + if(WIN32) + # also needed for build dir + add_custom_command(TARGET copy_qt_plugins + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${VISIT_QT_DIR}/plugins/${p} + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ThirdParty/qtplugins/${p}) + endif() + endif() + endforeach() + + if(WIN32) + visit_add_to_util_builds(copy_qt_plugins) + endif() + if(LINUX) # there is also a platform-plugin related library that # needs to be installed, but there doesn't seem to be # a way to find this via Qt's cmake mechanisms, hence this