Skip to content

Commit d005979

Browse files
Updated build instructions for macOS and Homebrew.
1 parent bd06571 commit d005979

File tree

5 files changed

+52
-24
lines changed

5 files changed

+52
-24
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE)
3+
# X86 is no longer supported, but you could edit this to bring it back.
4+
# set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE)
5+
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "" FORCE)
46

57
project(maskromtool VERSION 0.1 LANGUAGES CXX)
68

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ libreadline-dev qt6-declarative-dev
129129
...
130130
% cd maskromtool
131131
% git submodule init
132-
...
133-
% git submodule update
132+
% git submodule update --remote
134133
...
135134
% mkdir build; cd build
136135
% cmake ..
@@ -152,6 +151,31 @@ On macOS, you might need to run 'xattr -dr com.apple.quarantine *` if
152151
you get warnings about the signature not being recognized.
153152

154153

154+
To install on macOS, first install XCode, [Homebrew](https://brew.sh),
155+
and [Qt for Open Source](https://www.qt.io/download-qt-installer-oss),
156+
which sadly requires an account. After that, you can open
157+
`CMakeLists.txt` in QT Creator or use the release script to build.
158+
(Edit the script if its Qt version is older than yours.)
159+
160+
```
161+
% ./buildrelease-macos.sh
162+
... (ignore errors about signing
163+
% open release/maskromtool.app
164+
```
165+
166+
You can also build it without the official Qt installer or App,
167+
through Homebrew alone. This is roughly like what we'd do in Linux.
168+
169+
```
170+
% brew install cmake emacs qt
171+
% git submodule init
172+
% git submodule update --remote
173+
...
174+
% mkdir build; cd build
175+
% cmake ..
176+
% make -j 8 && sudo make install
177+
```
178+
155179
## GUI Usage
156180

157181
First use File/Open ROM to open a ROM image as a photograph. Try to

buildrelease-macos.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@ set -e
33

44

55
## This is the script that builds release bundles for macOS, leaving
6-
## the result in release/ in .app and .zip formats. It does not cross
7-
## compile or make Universal binaries, so I run it on both ARM64 and
8-
## AMD64 macs. I also don't sign the executables, which is a problem.
6+
## the result in release/ in .app and .zip formats. This used to be
7+
## universal, but now I only build for arm64 because x86_64 macs are
8+
## so old.
99

1010

1111
## These paths are hardcoded to prevent Homebrew for gunking things
1212
## up. Be sure to install *everything* in that version of Qt, or
1313
## you'll be missing important libraries like QtCharts.
14-
export QTDIR=~/Qt/6.9.0/macos/bin
15-
export CMAKE=~/Qt/6.9.0/macos/bin/qt-cmake
16-
export DEPLOYQT=~/Qt/6.9.0/macos/bin/macdeployqt
14+
export QTDIR=~/Qt/6.9.2/macos/bin
15+
export CMAKE=~/Qt/6.9.2/macos/bin/qt-cmake
16+
export DEPLOYQT=~/Qt/6.9.2/macos/bin/macdeployqt
1717

1818

1919

2020
## Remove the old releases.
2121
rm -rf build release
2222

2323
## We screwed up the 2024-06-23 release on macOS/x86_64 by forgetting to pull, so always do that.
24+
git submodule init
2425
git submodule update --remote
2526
git pull
2627

@@ -39,7 +40,7 @@ $DEPLOYQT release/maskromtool.app -dmg -sign-for-notarization="Developer ID Appl
3940
codesign --verify --verbose release/maskromtool.app
4041

4142
# Zip up a release.
42-
(cd release && zip -r maskromtool-macos-universal.zip maskromtool.app gatorom goodasm)
43+
(cd release && zip -r maskromtool-macos-arm64.zip maskromtool.app gatorom goodasm)
4344

4445

4546
echo "See release/ for the release files."

buildrelease.bat

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ rmdir /s /q Release
55

66
REM Don't forget to pull the new release.
77
git pull
8-
git submodule update
8+
git submodule init
9+
git submodule update --remote
910

1011

1112
REM Import the Qt and VS2022 paths.
12-
set PATH=C:\Qt\Tools\CMake_64\bin;C:\Qt\6.9.0\msvc2022_64\bin;%PATH%
13+
set PATH=C:\Qt\Tools\CMake_64\bin;C:\Qt\6.9.2\msvc2022_64\bin;%PATH%
1314
REM "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat"
1415
call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsMSBuildCmd"
1516

@@ -36,22 +37,22 @@ copy extern\goodasm\Release\goodasm.exe ..\Release\
3637
cd ..
3738

3839
REM Adding files that windeployqt forgets.
39-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6Charts.dll Release\
40-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6OpenGL.dll Release\
41-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6OpenGLWidgets.dll Release\
42-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6Widgets.dll Release\
43-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6Gui.dll Release\
44-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6PrintSupport.dll Release\
45-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6Pdf.dll Release\
46-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6Svg.dll Release\
47-
rem copy C:\Qt\6.9.0\msvc2022_64\bin\Qt6Core.dll Release\
48-
copy C:\Qt\6.9.0\msvc2022_64\bin\*.dll Release\
40+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6Charts.dll Release\
41+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6OpenGL.dll Release\
42+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6OpenGLWidgets.dll Release\
43+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6Widgets.dll Release\
44+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6Gui.dll Release\
45+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6PrintSupport.dll Release\
46+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6Pdf.dll Release\
47+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6Svg.dll Release\
48+
rem copy C:\Qt\6.9.2\msvc2022_64\bin\Qt6Core.dll Release\
49+
copy C:\Qt\6.9.2\msvc2022_64\bin\*.dll Release\
4950

5051
echo Finishing packing Release. Now making installer.
5152

5253

5354
REM Including the path.
54-
set PATH=C:\Qt\Tools\QtInstallerFramework\4.8\bin;C:\Qt\Tools\CMake_64\bin;C:\Qt\6.9.0\msvc2022_64\bin;C:\Qt\Tools\QtInstallerFramework\4.8\bin;%PATH%
55+
set PATH=C:\Qt\Tools\QtInstallerFramework\4.8\bin;C:\Qt\Tools\CMake_64\bin;C:\Qt\6.9.2\msvc2022_64\bin;C:\Qt\Tools\QtInstallerFramework\4.8\bin;%PATH%
5556

5657
REM Copying packages.
5758
xcopy/y/s Release\* Deployment\packages\com.maskromtool.maskromtool\data\

0 commit comments

Comments
 (0)