File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments