|
| 1 | +# macOS Build Fixes for OpenRV |
| 2 | + |
| 3 | +This document summarizes the fixes applied to enable building OpenRV on macOS (Apple Silicon). |
| 4 | + |
| 5 | +## Issues Identified and Fixed |
| 6 | + |
| 7 | +### 1. Qt Path Priority Issue (FIXED) |
| 8 | +**Problem:** CMake was finding Qt6 from Homebrew (`/opt/homebrew/lib/cmake/Qt6`) instead of the user-specified Qt installation, causing build failures because Homebrew Qt lacks QtWebEngineCore. |
| 9 | + |
| 10 | +**Fix Applied:** Modified `cmake/dependencies/qt6.cmake` to: |
| 11 | +- Prepend the specified Qt location to `CMAKE_PREFIX_PATH` (instead of appending) |
| 12 | +- Clear cached Qt6 variables to force re-discovery with the specified location |
| 13 | +- Updated error message to reference Qt 6.5.3 instead of Qt 5.15 |
| 14 | + |
| 15 | +**Files Changed:** |
| 16 | +- `cmake/dependencies/qt6.cmake` |
| 17 | + |
| 18 | +### 2. Missing Dependencies |
| 19 | + |
| 20 | +#### Required but Missing: |
| 21 | +1. **Qt 6.5.3** - Must be installed from official Qt installer (not Homebrew) |
| 22 | + - Download from: https://www.qt.io/download-open-source |
| 23 | + - Install Qt 6.5.3 to `~/Qt/6.5.3/macos` or similar location |
| 24 | + - Set `QT_HOME` environment variable or let `rvcmds.sh` auto-detect |
| 25 | + |
| 26 | +2. **Xcode Developer Directory** - Currently pointing to Command Line Tools |
| 27 | + - Run: `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer` |
| 28 | + - Verify with: `xcode-select -p` (should return `/Applications/Xcode.app/Contents/Developer`) |
| 29 | + |
| 30 | +#### Already Installed: |
| 31 | +- ✅ CMake 3.31.2 (meets requirement of 3.31.X+) |
| 32 | +- ✅ Ninja build system |
| 33 | +- ✅ Most Homebrew packages (ninja, readline, sqlite, xz, zlib, autoconf, automake, libtool, python@3.11, yasm, clang-format, black, meson, nasm, pkg-config, glew, rust) |
| 34 | + |
| 35 | +#### Potentially Missing: |
| 36 | +- ✅ `tcl-tk` - Now installed |
| 37 | + |
| 38 | +## Build Instructions |
| 39 | + |
| 40 | +### Prerequisites Setup |
| 41 | + |
| 42 | +1. **Install Qt 6.5.3:** |
| 43 | + ```bash |
| 44 | + # Download Qt 6.5.3 from https://www.qt.io/download-open-source |
| 45 | + # Install to default location: ~/Qt/6.5.3/macos |
| 46 | + ``` |
| 47 | + |
| 48 | +2. **Fix Xcode Developer Directory:** |
| 49 | + ```bash |
| 50 | + sudo xcode-select -s /Applications/Xcode.app/Contents/Developer |
| 51 | + xcode-select -p # Verify it returns /Applications/Xcode.app/Contents/Developer |
| 52 | + ``` |
| 53 | + |
| 54 | +3. **Install Missing Homebrew Packages (if needed):** |
| 55 | + ```bash |
| 56 | + brew install tcl-tk # Already installed |
| 57 | + ``` |
| 58 | + |
| 59 | +### Building OpenRV |
| 60 | + |
| 61 | +1. **Navigate to OpenRV directory:** |
| 62 | + ```bash |
| 63 | + cd /Users/tonylyons/Dropbox/Public/GitHub/OpenRV |
| 64 | + ``` |
| 65 | + |
| 66 | +2. **Source the build commands:** |
| 67 | + ```bash |
| 68 | + export RV_VFX_PLATFORM=CY2024 |
| 69 | + source rvcmds.sh |
| 70 | + ``` |
| 71 | + |
| 72 | +3. **First-time build:** |
| 73 | + ```bash |
| 74 | + rvbootstrap |
| 75 | + ``` |
| 76 | + |
| 77 | +4. **Subsequent builds:** |
| 78 | + ```bash |
| 79 | + rvmk |
| 80 | + ``` |
| 81 | + |
| 82 | +### Build Output Location |
| 83 | + |
| 84 | +- **Release build:** `_build/stage/app/RV.app/Contents/MacOS/RV` |
| 85 | +- **Debug build:** `_build_debug/stage/app/RV.app/Contents/MacOS/RV` |
| 86 | + |
| 87 | +## CMake Configuration |
| 88 | + |
| 89 | +The build system will automatically: |
| 90 | +- Download and build most dependencies (Boost, OpenEXR, OCIO, Python, etc.) |
| 91 | +- Use the specified Qt installation via `RV_DEPS_QT_LOCATION` |
| 92 | +- Configure for Apple Silicon (arm64) architecture |
| 93 | + |
| 94 | +## Notes |
| 95 | + |
| 96 | +- The fix ensures that when `RV_DEPS_QT_LOCATION` is specified, CMake will prioritize that location over system-installed Qt (like Homebrew) |
| 97 | +- All other dependencies are built from source during the build process |
| 98 | +- The build process uses a Python virtual environment (`.venv`) for Python dependencies |
0 commit comments