A C++ project template with Qt6 and CMake that downloads and compiles Qt. The resulting app is an executable that can be run on a system without Qt.
The main Qt6 configuration is found in the correspondent CMakeLists.txt file.
Note that statically compiled Qt6 weights more than 5 GB. The good thing is that user does not need whole compiled Qt6 with this configuration.
- CMake
- Ninja
- Git
On Linux: libgl1-mesa-dev libglu1-mesa-dev
and all dependencies are required.
Note that most of the libraries that match
*xcb*
and*xkb*
may be required on Linux.
Run the following commands from the project directory.
- Create CMake cache
This step may take a lot of time because it downloads and compiles Qt.
cmake -S . -B cmake-build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
- Build executable target
cmake --build cmake-build --target QtCMake
- Run executable target
- On Windows:
.\cmake-build\bin\QtCMake.exe
- On *nix:
./cmake-build/bin/QtCMake