Updated Building for macOS (markdown)

StupidRepo 2022-03-21 18:34:55 +00:00
parent d553e4888f
commit ca352daf4a
1 changed files with 65 additions and 0 deletions

@ -103,4 +103,69 @@ cd ./dolphin-emu
git pull origin
cd build
cmake .. && make
```
### FAQ
## When building Dolphin, I get errors
If you are receiving this error:
```
CMake Error at Source/Core/DolphinQt/CMakeLists.txt:9 (find_package):
By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5" (requested
version 5.9) with any of the following names:
Qt5Config.cmake
qt5-config.cmake
Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.
```
# Solution 1
If you have [Homebrew](https://brew.sh/) installed, and you installed QT5 from there, uninstall Homebrew QT5 using this command:
```bash
brew uninstall qt5
```
Then, download the offline installer from [qt.io/offline-installers](https://www.qt.io/offline-installers), run the installer inside the DMG file and log in or sign up to/for a `QT Account`.
On the `Installation Folder` step, select your home folder.
![Your local Home Directory](https://user-images.githubusercontent.com/69256931/159339892-cdf065b6-3f6f-48ac-848f-071dc853e376.png)
Then, on the `Select Components` page, expand the `Qt x.x.x` section and check the box next to `macOS`.
![Box selection](https://user-images.githubusercontent.com/69256931/159340196-6a405d7e-8f88-4d7f-b06f-1ae40f39a2a7.png)
After that, click `Next`, agree to the license(s), click `Next` again then finally, after all that time...
Click `Install`.
After it has finished installing, follow these steps:
Export your Qt5_DIR to the folder in your Qt installation with Qt5Config.cmake in it. In this case, it should be:
```bash
export Qt5_DIR=~/Qtx.x.x
```
(Replacing the `x`'s with the version numbers)
Append the Qt5_DIR to your PATH with `export PATH=$PATH:$Qt5_DIR`
And then...
`echo "export Qt5_DIR=$Qt5_DIR" >> ~/.bash_profile`
`echo 'export PATH=$PATH:$Qt5_DIR' >> ~/.bash_profile`
Now, we can build with CMake (make sure to `cd` into the Dolphin source folder!):
```bash
mkdir -p build
cd build
cmake ..
make
```