@MortyMars said in Deployment on macOS:
I haven't got round to it yet, but which options do you think are the most common and the most useful?
We found it necessary to do a few steps on macOS in order to get everything working. The last step is to make the .dmg a little nicer. Here is the script we are using:
#!/bin/bash
echo Delete old application folder.
rm -rf MyApp.app
echo Copy new application folder.
cp -r ../release/MyApp.app ./
install_name_tool -change /usr/local/lib/libomp.dylib @rpath/libomp.dylib MyApp.app/Contents/MacOS/MyApp
mkdir -p MyApp.app/Contents/Frameworks
cp libomp.dylib MyApp.app/Contents/Frameworks/
cp ../../3rdparty/lib3rdparty.dylib MyApp.app/Contents/Frameworks/
echo Bundle Qt libs.
/full/path/to/macdeployqt MyApp.app
echo Package examples.
cp -r examples MyApp.app/Contents/Resources/
echo Create dmg.
rm MyApp.dmg
bin/create-dmg --volname "MyApp Installer" --background ../src/rc/mac_dmg_background.png --window-pos 200 120 --window-size 598 465 --icon-size 80 --icon MyApp.app 150 330 --hide-extension "MyApp.app" --app-drop-link 450 330 MyApp.dmg MyApp.app
echo Done.
You see some extra steps that are necessary in our case. For libomp we need to change the rpath, we need to add some dynamic libraries by hand, and we also package some exampled.
The mac_dmg_background.png has our company logo and two transparent boxes where the app icon and the link to the application folder go. Between these two is an arrow suggesting to move the app to the application folder (for installation). There is an additional mac_dmg_background@2x.png for Retina displays in the same folder.