M1 macOS Qt环境搭建 + Qt5.15源码编译 + Homebrew QtCreator 8

how_to_build_qt_creator_for_macos_arm64_a_guide/
https://www.cnblogs.com/wqcwood/p/15138983.html
Installing Clang for QDoc

Notice !! This only build Qt for arm64 version. Not universal. you can read this article for universal

1. Install Xcode

please google

2. Install Homebrew

please google

3. Install others need

  • Get Qt build dependencies (using homebrew)
brew install pcre2 harfbuzz freetype
  • Get Qt Creator dependencies (using homebrew)
brew install cmake ninja python
brew install --build-from-source llvm

4. Get Qt5.15.5 source code

5. Install Clang for QDoc

  • check llvm is install
llvm-config

在这里插入图片描述

  • Find llvm install path
which llvm-config

out: /opt/homebrew/opt/llvm/bin/llvm-config

  • Specify Clang location manually
$ export LLVM_INSTALL_DIR=/opt/homebrew/opt/llvm

6. Build Qt for mac (m1)

  • open terminal and chang dir to ~/Downloads/qt-everywhere-src-5.15.5
    then
./configure -debug-and-release -prefix ./out QMAKE_APPLE_DEVICE_ARCHS=arm64 -skip qt3d -skip qtvirtualkeyboard

skip qt3d skip qtvirtualkeyboard because of build error! https://bugreports.qt.io/browse/QTBUG-98826

  • If Error Message: You cannot configure qt separately within a top-level build
    Making two blank files named .qmake.stash and .qmake.super
    then go on configure. FUXXING QT!!!
touch .qmake.stash
touch .qmake.super
  • Then choose open source, and choose yes.
    !!!Check QDoc is config yes to install.!!!
    then
make
  • If error occurred!:
    在这里插入图片描述
  • !!! open qiosurfacegraphicsbuffer.h then include :
#include <CoreGraphics/CGColorSpace.h>
#include <IOSurface/IOSurface.h>
  • like:
    在这里插入图片描述
  • Make again and make install
make 
make install
  • If there are other errors, please follow the prompts and solve them one by one!!!
    if build success,you will find lib in path:
~/Downloads/qt-everywhere-src-5.15.5/out
check bin/qdoc has build succeeed. it will build qt doc for qt assistant
  • make docs
make docs
make install_docs
  • out->bin:
    在这里插入图片描述

7. Install Qt creator use Homebrew

  • Use homebrew (You can also use brew to install qt, but is newest. Not Qt5~)
brew install Qt Creator

在这里插入图片描述

8 Config Qt Creator

  • You will found .qch will be auto detected.if not you can add by youself.
    在这里插入图片描述
  • Config Qt version
find you qmake path ,and set it
  • config kits

  • Open examples maybe get some trouble. x86_64 set in .pro
QMAKE_APPLE_DEVICE_ARCHS=arm64

Debug into Qt source see:

click me

  • 0
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
macOS 是苹果公司的操作系统,提供了强大的性能和稳定性。Qt 是一个跨平台的应用程序框架,它能够帮助开发者快速构建跨平台的应用程序。Excel 是微软公司的电子表格软件,广泛应用于各个领域。那么,macOS 上能否使用 Qt 开发 Excel 相关的应用程序呢? 答案是肯定的。macOS 上可以使用 Qt 开发 Excel 相关的应用程序。Qt 是跨平台的,可以在各个操作系统上运行,包括 macOS。开发者可以使用 Qt 提供的图形界面和各种功能模块来构建一个功能丰富的 Excel 应用程序。 通过 Qt,开发者可以使用 C++ 或者其他编程语言来编写 Excel 应用程序。Qt 提供了丰富的 API,可以方便地读取和写入 Excel 文件,进行数据的编辑和计算操作。同时,Qt 还提供了图形界面组件,开发者可以根据需要进行界面的设计和布局。 在 macOS 上,Qt 提供了完整的集成开发环境(IDE),开发者可以使用这个工具来快速创建和调试应用程序。同时,Qt 还提供了强大的跨平台的支持,可以帮助开发者轻松地将应用程序移植到其他操作系统上去。 总而言之,macOS 上可以使用 Qt 开发 Excel 相关的应用程序。Qt 提供了丰富的功能和工具,可以帮助开发者快速构建功能强大的 Excel 应用程序,并且能够实现跨平台的运行。对于使用 macOS 的开发者来说,Qt 是一个非常实用的工具。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值