https://github.com/bialger/qtcmake
A C++ crossplatform project template with Qt6 and CMake that is linked statically
https://github.com/bialger/qtcmake
ci-cd cpp-template crossplatform project-template qt qt-cmake qt6
Last synced: 3 months ago
JSON representation
A C++ crossplatform project template with Qt6 and CMake that is linked statically
- Host: GitHub
- URL: https://github.com/bialger/qtcmake
- Owner: bialger
- License: gpl-3.0
- Created: 2024-09-14T16:16:05.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-17T22:39:11.000Z (over 1 year ago)
- Last Synced: 2025-01-31T03:27:23.269Z (about 1 year ago)
- Topics: ci-cd, cpp-template, crossplatform, project-template, qt, qt-cmake, qt6
- Language: CMake
- Homepage:
- Size: 36.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QtCMake
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](lib/qt/CMakeLists.txt) 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.
## Prerequisites
* 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.
## How to build and run
Run the following commands from the project directory.
1. Create CMake cache
This step may take a lot of time because it downloads and compiles Qt.
```shell
cmake -S . -B cmake-build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
```
2. Build executable target
```shell
cmake --build cmake-build --target QtCMake
```
3. Run executable target
* On Windows:
```shell
.\cmake-build\bin\QtCMake.exe
```
* On *nix:
```shell
./cmake-build/bin/QtCMake
```