@@ -140,6 +140,36 @@ echo $STAGING_AREA_DEPS/lib | dylibbundler -ns -of -b \
140140echo " === Bundle the Qt libraries & Create Scopy.dmg"
141141macdeployqt Scopy.app -verbose=3
142142
143+ echo " === Adding Qt5 3D plugins"
144+ # Find Qt5 installation path
145+ QT5_PLUGINS_PATH=" $( brew --prefix qt@5) /plugins"
146+
147+ # Copy Qt5 3D specific plugins
148+ if [ -d " $QT5_PLUGINS_PATH /renderers" ]; then
149+ echo " Copying Qt5 3D renderers plugins..."
150+ mkdir -p " $BUILDDIR /Scopy.app/Contents/PlugIns/renderers"
151+ cp -R " $QT5_PLUGINS_PATH /renderers" /* " $BUILDDIR /Scopy.app/Contents/PlugIns/renderers/"
152+ fi
153+
154+ if [ -d " $QT5_PLUGINS_PATH /sceneparsers" ]; then
155+ echo " Copying Qt5 3D sceneparsers plugins..."
156+ mkdir -p " $BUILDDIR /Scopy.app/Contents/PlugIns/sceneparsers"
157+ cp -R " $QT5_PLUGINS_PATH /sceneparsers" /* " $BUILDDIR /Scopy.app/Contents/PlugIns/sceneparsers/"
158+ fi
159+
160+ # Fix library paths for the copied plugins
161+ echo " === Fixing Qt5 3D plugin library paths"
162+ QT5_3D_PLUGINS=$( find " $BUILDDIR /Scopy.app/Contents/PlugIns" -name " *.dylib" -path " */renderers/*" -o -path " */sceneparsers/*" )
163+
164+ for plugin in $QT5_3D_PLUGINS ; do
165+ echo " Fixing plugin: ${plugin##*/ } "
166+ # Use dylibbundler to fix dependencies
167+ dylibbundler --no-codesign --overwrite-files --bundle-deps --create-dir \
168+ --fix-file " $plugin " \
169+ --dest-dir " $BUILDDIR /Scopy.app/Contents/Frameworks/" \
170+ --install-path @executable_path/../Frameworks/ \
171+ --search-path " $BUILDDIR /Scopy.app/Contents/Frameworks/"
172+ done
143173
144174echo " === Removing duplicated LC_RPATH"
145175list=$( find Scopy.app -name " *.dylib" )
0 commit comments