Skip to content

Commit

Permalink
Update README with build instruction using new cmake build system for…
Browse files Browse the repository at this point in the history
… macOS
  • Loading branch information
phunkyfish committed Jul 28, 2024
1 parent 2eaddaf commit 7c3542e
Showing 1 changed file with 53 additions and 19 deletions.
72 changes: 53 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,60 +78,94 @@ The finished executable is located at `C:\usb-sd-creator\releases`.

### 1. Install XCode with Command-line tools

### 2. Setup QT 6.6.2 (static build or shared)
### 2. Setup QT 6.7.2

#### Static build
#### Install pre-requisites

Open a command prompt and type the following in the console:
The build requires both `python3` and `cmake`. If you don't have them installed, run the following commands:

```
mkdir -p ~/Downloads ~/Qt
cd ~/Downloads
brew install python
brew install cmake
```

Now install `aqt`, a command line package manager for `QT`:

wget https://download.qt.io/official_releases/qt/6.6/6.6.2/single/qt-everywhere-src-6.6.2.tar.xz
tar xf qt-everywhere-src-6.6.2.tar.xz
cd qt-everywhere-src-6.6.2
./configure -static -no-shared -release -opensource -confirm-license -silent -prefix ~/Qt/6.6.2-static -nomake examples -nomake tests -no-strip -no-cups -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-harfbuzz -qt-freetype
ninja qtbase/all qttools/all
ninja install
```
pip3 install aqtinstall --break-system-packages
```

#### Install required QT packages

#### Shared library
To see the available QT versions run:

```
aqt list-qt mac desktop
```

TODO
Install the required packages:

```
aqt install-qt --outputdir ~/Qt mac desktop 6.7.2 --archives qtbase qttools
```

### 4. Build USB-SD-Creator

Assuming the repo is in your home directory

```
cd ~/usb-sd-creator
```

./osx_build.sh
#### Debug build
```
cmake -S . -B build -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build build
```

If building again cleanup using:
#### Release build
```
./osx_clean.sh
cmake --preset release -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build --preset release
```

### 5. Run USB-SD-Creator

#### Open the app

Simply double click the app from a finder window in the root of the repo: `LibreELEC USB-SD Creator`
Simply double click the app from a finder window in the `build` folder in the repo: `build/LibreELEC USB-SD Creator`

#### Command line

Run the app from the command line, that will prompt for a password:
```
./LibreELEC\ USB-SD\ Creator.app/Contents/MacOS/LibreELEC\ USB-SD\ Creator
./build/LibreELEC\ USB-SD\ Creator.app/Contents/MacOS/LibreELEC\ USB-SD\ Creator
```

**Or:**

Run the app from the command line using sudo

```
sudo ./LibreELEC\ USB-SD\ Creator.app/Contents/MacOS/LibreELEC\ USB-SD\ Creator
sudo ./build/LibreELEC\ USB-SD\ Creator.app/Contents/MacOS/LibreELEC\ USB-SD\ Creator
```

### 6. Debugging USB-SD-Creator

#### Using QT Creator

If you need to, install QT Creator:

```
brew install --cask qt-creator
```

Then simply open CMakeLists.txt in QT Creator

#### Using XCode

Build the xcode project, and open the project file in Xcode, located in the build folder (note you may need to clear any previous build files before genreating for XCode):

```
cmake -S . -B build -G Xcode -D CMAKE_PREFIX_PATH="/Users/$USER/Qt/6.7.2/macos" && cmake --build build
```


0 comments on commit 7c3542e

Please sign in to comment.