Skip to content

Commit 3e1f4e6

Browse files
committed
Packaging: fixed qt5 plugins copy
1 parent ab1518b commit 3e1f4e6

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

app/CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,25 @@ IF((APPLE AND BUILD_AS_BUNDLE) OR WIN32)
105105
# Install needed Qt plugins by copying directories from the qt installation
106106
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
107107
# Exclude debug libraries
108-
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
108+
IF(QT_PLUGINS_DIR)
109+
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
109110
DESTINATION ${plugin_dest_dir}/plugins
110111
COMPONENT runtime
111112
REGEX ".*d4.dll" EXCLUDE
112113
REGEX ".*d4.a" EXCLUDE)
114+
ELSE()
115+
#Qt5
116+
foreach(plugin ${Qt5Gui_PLUGINS})
117+
get_target_property(plugin_loc ${plugin} LOCATION)
118+
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
119+
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
120+
list(GET loc_list 1 plugin_type)
121+
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}/plugins${plugin_type}\"")
122+
INSTALL(FILES ${plugin_loc}
123+
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
124+
COMPONENT runtime)
125+
endforeach()
126+
ENDIF()
113127

114128
# install a qt.conf file
115129
# this inserts some cmake code into the install script to write the file

0 commit comments

Comments
 (0)