I spent a load of time trying to create a build of LLVM I could use only to keep hitting linker errors (cant remember the details, but LLVM was reporting a redirect link in its dependencies instead of the actual lib). The homebrew recipe *is* really useful for LLVM though. Nice to hear! I suspected the other dependencies were unnecessary, and just cause issues with macdeployqt, but included them because I wanted to give the best chance of reproducing my success. Which should copy the necessary files from Qt into the App bundle necessary for relocation, but no clue if that actually works given that we used homebrew for some of the dependencies (and I don't have a second M1 to test with).
![qt for mac qt for mac](https://mac-cdn.softpedia.com/screenshots/QT-Sync_4.jpg)
qt5-5.15-macOS-release/qtbase/bin/macdeployqt Qt\ Creator.app Now you should have "Qt Creator.app" which is an ARM64 version of Qt Creator.Īnd if you want to get real fancy (and still might not work as intended) you can try:
![qt for mac qt for mac](https://i.stack.imgur.com/cesH7.png)
qt-creatorĬmake -DCMAKE_BUILD_TYPE=Release -G Ninja "-DCMAKE_PREFIX_PATH=./qt5-5.15-macOS-release/qtbase/" -DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3. Git clone git://code.qt.io/qt-creator/qt-creator.gitĬmake -DCMAKE_BUILD_TYPE=Release -G Ninja "-DCMAKE_PREFIX_PATH=./qt5-5.15-macOS-release/qtbase/ /opt/homebrew/opt/llvm" -DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3. Also notice the skipping of qt3d and qtwebengine, do not mistake this for mercy, they in fact do not build with macOS ARM64 currently.
![qt for mac qt for mac](https://miro.medium.com/max/1154/1*--wTYv84LNQUpd-E0YXnZw.png)
This is a pretty common pattern we use for Qt development (its also one of the nice things that the -developer-build configure flag does, but we don't do that here because we want a release build). By setting the -prefix value to "./qtbase" you essentially say that you are installing to the place where it already was. When that completes, there is no need to run make install.
#QT FOR MAC DOWNLOAD#
If that is correct, then all the rituals have been performed, and you can move on to building Qt which again will take quite awhile, but maybe not as long as to download Qt because the M1 Macs are crazy fast to build stuff. This should configure Qt without errors and you should confirm that it says this at the top of the configuration output:īuild type: macx-clang (arm64, CPU features: neon crc32) qtbase -nomake examples -nomake tests QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -skip qt3d -skip qtwebengine Create a build folder outside of your Qt source directory. Ok now that that is done we can build things. But since people seem to miss these modules in Qt 6, why not take a moment(or hour) to reflect on the largess of Qt 5 by downloading everything? It's possible to skip downloading some modules, and Qt Creator certainly doesn't use all of them. WebEngine takes like half the time because it contains Chromium which is larger than Qt. This step takes forever because it needs to pull down every module, and for Qt 5.15 there are ALOT.
#QT FOR MAC CODE#
This will basically give you the last bit of opensource code before the 5.15 repo went private. We need some unreleased code so you need to get it using git. Building Qt 5.15.x (unreleased/opensource)įirst get all the source code for Qt 5.15. I include them because I already have them in my environment, and we recommend them in some of our cmake build documentation for Qt 6 (even though we're building for Qt 5 in this case). Not so sure about the pcre2, harfbuzz, and freetype dependencies, because if you didn't have them we would just build them anyway, and by using the brew version it likely makes the build unmovable from the development machine. The homebrew source has the patches necessary to build a working LLVM. Also using the homebrew version is the easiest because there are outstanding issues with building LLVM for macOS ARM64 that requires an unreleased version of LLVM to overcome, which isn't even supported by Qt Creator.
#QT FOR MAC INSTALL#
The LLVM install is optional, but is necessary for the extra clang code model in Qt Creator. Get Qt build dependencies (using homebrew)īrew install pcre2 harfbuzz freetype Get Qt Creator dependencies (using homebrew) I'm publishing this guide because it is possible to do now with unreleased code, and it makes tasks like debugging from Qt Creator on the M1 Macs possible.
![qt for mac qt for mac](https://cdn-images-1.medium.com/max/1600/1*EsUXI3AepHTy_avBTAtVMg.png)
And just so we are clear there is not even a version that is available for commercial customers of Qt. Also it uses unreleased (potentially unstable) code, but it does assume using the publicly available code for 5.15 and Qt Creator (not some hidden magic that doesn't exist yet in a private repo). This is an "unofficial guide" since there is not "official" support for Qt Creator or Qt for that matter on macOS ARM64. Since this topic keeps coming up, and maybe my previous instructions were not enough for people to reproduce my build, I've written a whole guide on how I was able to build Qt Creator for macOS ARM64.