Improve macOS create_dmg script and update Qt Creator build instructions.

This commit is contained in:
sawinglogz 2020-01-07 19:40:58 -05:00
parent 50b47a9bff
commit b6c2aa4610
3 changed files with 15 additions and 13 deletions

View File

@ -77,17 +77,13 @@ NOTE: Official builds are currently made with [macOS 10.14 Mojave] and Command-L
3. Click to expand "Details" for the **qmake** build step. 3. Click to expand "Details" for the **qmake** build step.
4. Uncheck "Enable Qt Quick Compiler", click "No" to defer recompiling. 4. Uncheck "Enable Qt Quick Compiler", click "No" to defer recompiling.
4. Configure packaging for distribution: 4. Configure packaging for distribution:
1. Copy the "Build directory" path from the **Build Settings** panel above. (Default is "/Users/build/OSCAR-code/build-oscar-Desktop_Qt_5_12_5_clang_64bit-Release") 1. Click "Clone..." to the right of the "Edit build configuration" drop-down menu.
2. Tools > External > Configure... 2. Name the new configuration "Deploy".
3. Select "Add Tool" from the "Add" drop-down menu near the bottom of the window. 3. Click to expand "Details" for the **Make** build step.
4. Set the name to "Deploy". 4. Set the Make arguments for the Make step to "dist-mac".
5. Set the Description to "Creates a distributable .dmg". 5. To build OSCAR, select "Release" from the "oscar" button in the left panel. Then select Build > Build Project "oscar". The application is in OSCAR.app.
6. Set the Executable to the full path where you installed Qt: "/Users/build/Qt5.12.5/5.12.5/clang_64/bin/macdeployqt". 6. To build OSCAR and package for distribution, select "Deploy" from the "oscar" button in the left panel. Then select Build > Build Project "oscar". The dmg is at OSCAR.dmg.
7. Set the Arguments to "OSCAR.app -dmg". * Progress in "Compile Output" will pause for several seconds while "Creating .dmg". This is normal.
8. Set the working directory to the build directory path copied in step 1.
9. Click OK.
5. To compile, select Build > Build Project "oscar". The application is in OSCAR.app.
6. To create a .dmg, select Tools > External > Deploy. The dmg is at OSCAR.dmg. **Note that the resulting .dmg will NOT include the README.**
[Qt 5.12.5]: http://download.qt.io/archive/qt/5.12/5.12.5/qt-opensource-mac-x64-5.12.5.dmg [Qt 5.12.5]: http://download.qt.io/archive/qt/5.12/5.12.5/qt-opensource-mac-x64-5.12.5.dmg
[macOS 10.14 Mojave]: https://apps.apple.com/us/app/macos-mojave/id1398502828?ls=1&mt=12 [macOS 10.14 Mojave]: https://apps.apple.com/us/app/macos-mojave/id1398502828?ls=1&mt=12

View File

@ -515,4 +515,5 @@ macx {
# Add a dist-mac target to build the distribution .dmg. # Add a dist-mac target to build the distribution .dmg.
QMAKE_EXTRA_TARGETS += dist-mac QMAKE_EXTRA_TARGETS += dist-mac
dist-mac.commands = QT_BIN=$$[QT_INSTALL_PREFIX]/bin $$_PRO_FILE_PWD_/scripts/create_dmg OSCAR OSCAR.app $$_PRO_FILE_PWD_/../Building/MacOS/README.rtfd dist-mac.commands = QT_BIN=$$[QT_INSTALL_PREFIX]/bin $$_PRO_FILE_PWD_/scripts/create_dmg OSCAR OSCAR.app $$_PRO_FILE_PWD_/../Building/MacOS/README.rtfd
dist-mac.depends = $${TARGET}.app/Contents/MacOS/$${TARGET}
} }

View File

@ -17,10 +17,15 @@ do
done done
if [[ ${APP} != "" ]]; then if [[ ${APP} != "" ]]; then
if [[ -z "$QT_BIN" ]]; then
echo "Error: QT_BIN must be defined"
exit 1
fi
# Create deployable application bundle (if it hasn't been already been done) # Create deployable application bundle (if it hasn't been already been done)
if [[ ! -d "${APP}/Contents/Frameworks/QtCore.framework" ]]; then if [[ ! -d "${APP}/Contents/Frameworks/QtCore.framework" ]]; then
echo $QT_BIN/macdeployqt "${APP}" echo "${QT_BIN}"/macdeployqt "${APP}"
$QT_BIN/macdeployqt "${APP}" "${QT_BIN}"/macdeployqt "${APP}" || exit
fi fi
# TODO: add version number to target .dmg filename # TODO: add version number to target .dmg filename