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 c5aaa2d
Showing 1 changed file with 48 additions and 22 deletions.
70 changes: 48 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,36 @@ 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`:

```
pip3 install aqtinstall --break-system-packages
```

#### Install required QT packages

To see the available QT versions run:

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
```
aqt list-qt mac desktop
```

#### Shared library
Install the required packages:

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

### 4. Build USB-SD-Creator

Expand All @@ -107,31 +116,48 @@ Assuming the repo is in your home directory
```
cd ~/usb-sd-creator
./osx_build.sh
```

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

### 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 c5aaa2d

Please sign in to comment.