Skip to content

Commit

Permalink
Install more qt plugins. (#19427)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
biagas authored Apr 9, 2024
1 parent d262571 commit 6b80cc0
Showing 1 changed file with 45 additions and 50 deletions.
95 changes: 45 additions & 50 deletions src/CMake/FindVisItQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
#*****************************************************************************

#[====[
Expand Down Expand Up @@ -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}/$<CONFIG>/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}/$<CONFIG>/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
Expand Down

0 comments on commit 6b80cc0

Please sign in to comment.