Category Archives: QT

Building Lines Game for MacOS and iOS

To build my app for iOS I tried to run CMake from the command line without QT Creator:

cmake -S /Users/admin/dev/repos/examples/src/LinesGame/LinesGameQt -B . -DCMAKE_GENERATOR:STRING=Xcode \
  -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=./.qtc/package-manager/auto-setup.cmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/Users/admin/dev/libs/QT6/release/iOS/bin/qmake6 \
  -DCMAKE_PREFIX_PATH:PATH=/Users/admin/dev/libs/QT6/release/iOS \
  -DCMAKE_TOOLCHAIN_FILE:FILEPATH=/Users/admin/dev/libs/QT6/release/iOS/lib/cmake/Qt6/qt.toolchain.cmake \

Publishing MacOS QT app in Apple App Store

First I set CMake generator to XCode in QT Creator Kits settings page:


Publishing iOS QT app in Apple App Store

I downloaded provisioning profiles with XCode:


Building QT6.7 on MacOS Sonoma

I installed MacOS Sonoma on HyperV, installed XCode and used the following commands to check compiler and SDK versions:

admin@son ~ % xcode-select -print-path
admin@son ~ %  xcrun -sdk macosx -find clang
admin@son ~ % clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/
admin@son ~ % xcrun -sdk macosx --show-sdk-path

Configuring QT Creator with QT 6.6.2

I built QT 6.6.2, installed QT Creator and updated "%SystemDrive%\Documents and Settings\%USERNAME%\Application Data\QtProject\qtcreator\android\sdk_definitions.json" file as follows:


"specific_qt_versions": [
        "versions": ["default"],
        "sdk_essential_packages": ["build-tools;34.0.0", "ndk;26.2.11394342"]
        "versions": ["6.4"],
        "sdk_essential_packages": ["build-tools;31.0.0", "ndk;23.1.7779620"]
        "versions": ["6.3", "6.2", "5.15.[9-20]"],
        "sdk_essential_packages": ["build-tools;31.0.0", "ndk;22.1.7171670"]
        "versions": ["5.15.[0-8]", "5.14.[0-2]", "5.13.2", "6.0", "6.1"],
        "sdk_essential_packages": ["build-tools;31.0.0", "ndk;21.3.6528147"]
        "versions": ["5.12.[0-5]", "5.13.[0-1]"],
        "sdk_essential_packages": ["build-tools;28.0.2", "ndk;19.2.5345600"]



Building QT 6.6.2 for Windows and Android

I installed MS Visual Studio, Android Studio and the following tools:


and built QT for Windows with the following commands:


Unification of Win32 and UWP

Looks like QT6 does not support UWP:

During this year’s Microsoft Build conference Microsoft announced the
unification of Win32 and UWP for their IoT offering. In general, it
looks like Microsoft is stepping away from their strict stance about the
usage of UWP technology and the Windows Store. Getting a classic Windows
application into the Windows Store is much easier nowadays and will be
even simpler in the future. Microsoft’s new direction in their IoT
offering will bring more “classic Windows development” into the IoT
world and there will be no need for a dedicated UWP port.

Compiling a single C++ source file in QT Creator

My QT Creator builds an Android app with the following command:

"D:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build D:/dev/repos/tradeclient/src/build-TradeClient-Android_Qt_6_5_2_arm64_v8a_debug_Clang_arm64_v8a-Debug --target all

I simply started Windows Command Prompt and was able to run the following commands:

set PATH=%PATH%;C:\Qt\qtcreator-10.0.2\bin\jom
cd D:\dev\repos\tradeclient\src\build-TradeClient-Android_Qt_6_5_2_arm64_v8a_debug_Clang_arm64_v8a-Debug
"D:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build . --target BotFactory.cpp.o
"D:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build . --target ExchangeModel.cpp.o > my.txt 2>&1
"D:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build . --target Bots/ShortBot.cpp.o > my2.txt 2>&1

Building QT6.5.2 for X11 on Ubuntu 22.04

In addition to the packages installed while building QT6.4 I installed the following packages required for X11:

sudo apt install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev \
  libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev \
  libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev \
  libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev \
  libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev \
  libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev

And configured QT with dynamic linking:

export MY_INSTALL_PATH=/home/def/libs/QT6.5d
export QT_SRC_PATH=/home/def/repos/qt-everywhere-src-6.5.2

${QT_SRC_PATH}/configure -prefix $MY_INSTALL_PATH -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -opensource -confirm-license \
  -c++std c++20 -openssl-linked \
  -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity \
  -skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua \
  -skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects \
  -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard \
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech -skip qtlocation \
  -skip qthttpserver

Building QT6.4 for Windows with Vulkan support

Installed Vulkan SDK and built QT6.4.2 for windows with the following script:


"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64


mkdir \dev\build\qt
cd \dev\build\qt
set "CMAKE_ROOT=%MY_DRIVE%\dev\tools\cmake-3.24.2-windows-x86_64\bin"
set "NINJA_ROOT=%MY_DRIVE%\dev\tools\ninja-win"
set "PERL_ROOT=%MY_DRIVE%\dev\tools\Strawberry\perl\bin"
set "PYTHON_ROOT=%MY_DRIVE%\dev\tools\Python35"
set VULKAN_SDK=%MY_DRIVE%/dev/tools/VulkanSDK/