Environment Setup & Build

Package structure

_images/flow.png

Windows

Install Qt Download Qt 5.15.2 library from Qt Official Webpage Install Qt then set environment variable and specify QTDIR.

Currently our recommended compiler is MSVC as it’s the one we regularly test with. You may opt for a different compiler, but we cannot guarantee the Samples will be built correctly.

macOS

x86_64: Download from Official QT webpage or Homebrew

arm64: Not available from Official webpage hence either build from source code or install from Homebrew

When building a Universal Binary

  • Download Qt for both x86_64 & arm64 then build plugin for both architectures separately then merge these two plugin binaries to universal binary.

  • If not downloaded via Homebrew then set QTDIR environment variable, otherwise this step is not necessary.

Build Settings for Apple Silicon This section is for when you want to compile arm64 native builds (Apple Silicon)

Download both arm64, x86_64 versions of Qt 5.15.2

We use qt@5 formula from Homebrew for arm64 slice. Please download both arm64 & x86_64 slices in case you need to create a universal app.

Version

Source

Formula

Commit (Hash)

Bottle

Apple Silicon (Arm64)

Qt 5.15.2

Homebrew or build from source code

qt@5

b0a871aadd4d51af8fff4c0580d1fafbaa72bd16

arm64_big_sur

Intel-based (x86_64)

Qt 5.15.2

Qt Distributed Binaries

N/A

N/A

N/A

arm64 slice

Please follow below steps if you are downloading from Homebrew

curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/b0a871aadd4d51af8fff4c0580d1fafbaa72bd16/Formula/qt@5.rb > qt@5.rb
brew install qt@5.rb
#In case you wish to revert qt@5.rb's commit to its latest state:
git checkout origin/master qt@5.rb

CMake Build

CMake Configuration

  • Windows & macOS with QtDIR environment variable set

cmake -S . -B build
  • macOS with Qt from Homebrew

cmake -S . -D USE_HOMEBREW=ON -B build

Build

cmake --build build --config Release -j 10

IDE supports

CMake supports many IDEs / Text Editors, either as a generator or fully natively. Please refer to online resources for the details. Here we provide a few pages as a starting point.