Skip to content

Commit 46e7998

Browse files
committed
added QT6, extended infrastructure
QT is moved to a separate CMakePreset, because first time configuring will take a lot of time and only one job is enough to check that.
1 parent f0744d7 commit 46e7998

5 files changed

Lines changed: 102 additions & 5 deletions

File tree

.github/workflows/build_cmake.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,57 @@ jobs:
235235
- name: Build
236236
shell: bash
237237
run: cmake --build --preset build-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}
238+
239+
linux-qt:
240+
name: ${{ matrix.os }}, ${{ matrix.compiler.name }}, C++${{ matrix.cxx }}
241+
runs-on: ${{ matrix.os }}
242+
strategy:
243+
fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix entry fails.
244+
matrix:
245+
os: [ubuntu-22.04]
246+
compiler: [ {name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15'} ]
247+
cxx: [20]
248+
249+
steps:
250+
- uses: actions/checkout@v3
251+
252+
- name: Cache
253+
uses: actions/cache@v3
254+
env:
255+
cache-name: cache-conan-modules
256+
with:
257+
path: |
258+
${{ env.CONAN_USER_HOME }}
259+
~/.cache/pip
260+
key: ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
261+
262+
- name: Install conan
263+
shell: bash
264+
run: |
265+
python3 -m pip install --upgrade pip setuptools conan
266+
source ~/.profile
267+
268+
- name: Install dependencies
269+
run: |
270+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
271+
sudo apt update
272+
sudo apt install ninja-build ${{ matrix.compiler.pkgs }} libx11-xcb-dev libfontenc-dev libice-dev libsm-dev
273+
libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev
274+
libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev
275+
libxss-dev libxt-dev libxtst-dev libxv-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev
276+
libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev
277+
libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-cursor-dev
278+
libxcb-util-dev libxcb-util0-dev libx11-xcb1 libx11-xcb libx11-dev libgl-dev libgl1-mesa-dev
279+
shell: bash
280+
281+
- name: Configure via CMake
282+
shell: bash
283+
run: cmake --preset ${{ matrix.compiler.preset }}-qt -DCXX_STANDARD=${{ matrix.cxx }}
284+
285+
- name: Build
286+
shell: bash
287+
run: cmake --build --preset build-${{ matrix.compiler.preset }}-qt
288+
289+
- name: Test
290+
shell: bash
291+
run: ctest --preset test-${{ matrix.compiler.preset }}-qt

CMakePresets.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"binaryDir": "${sourceDir}/out/build/${presetName}",
1414
"installDir": "${sourceDir}/out/install/${presetName}",
1515
"environment": {
16-
"NOT_ON_C3I": "1"
16+
"DONT_CONFIGURE_QT": "1"
1717
},
1818
"cacheVariables": {
1919
"CPP_STARTER_USE_SML": "ON",
@@ -407,6 +407,23 @@
407407
"CMAKE_C_COMPILER": "clang-15",
408408
"CMAKE_CXX_COMPILER": "clang++-15"
409409
}
410+
},
411+
{
412+
"name": "clang-15-qt",
413+
"displayName": "Clang 15 QT",
414+
"inherits": "conf-unixlike-common",
415+
"cacheVariables": {
416+
"CMAKE_C_COMPILER": "clang-15",
417+
"CMAKE_CXX_COMPILER": "clang++-15",
418+
"CPP_STARTER_USE_SML": "OFF",
419+
"CPP_STARTER_USE_BOOST_BEAST": "OFF",
420+
"CPP_STARTER_USE_CROW": "OFF",
421+
"CPP_STARTER_USE_CPPZMQ_PROTO": "OFF",
422+
"CPP_STARTER_USE_QT": "ON"
423+
},
424+
"environment": {
425+
"NOT_ON_C3I": "1"
426+
}
410427
}
411428
],
412429
"buildPresets": [
@@ -544,6 +561,11 @@
544561
"name": "build-clang-15-fuzzing",
545562
"displayName": "Linux Clang 15 Fuzzing",
546563
"configurePreset": "clang-15-fuzzing"
564+
},
565+
{
566+
"name": "build-clang-15-qt",
567+
"displayName": "Linux Clang 15 QT",
568+
"configurePreset": "clang-15-qt"
547569
}
548570
],
549571
"testPresets": [
@@ -716,6 +738,12 @@
716738
"displayName": "Linux Clang 15 Fuzzing",
717739
"inherits": "test-common",
718740
"configurePreset": "clang-15-fuzzing"
741+
},
742+
{
743+
"name": "test-clang-15-qt",
744+
"displayName": "Linux Clang 15 QT",
745+
"inherits": "test-common",
746+
"configurePreset": "clang-15-qt"
719747
}
720748
]
721749
}

cmake/Options.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ OPTION(CPP_STARTER_USE_BOOST_BEAST "Enable compilation of boost beast sample" OF
3535
OPTION(CPP_STARTER_USE_CROW "Enable compilation of crow sample" OFF)
3636
OPTION(CPP_STARTER_USE_CPPZMQ_PROTO "Enable compilation of protobuf and cppzmq sample" OFF)
3737
OPTION(CPP_STARTER_USE_EMBEDDED_TOOLCHAIN "Enable compilation of an example cortex m4 project" OFF)
38+
OPTION(CPP_STARTER_USE_QT "Enable compilation of an example QT project" OFF)

conanfile.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import conans.model.requires
24
from conan import ConanFile
35
from conan.tools.cmake import CMakeToolchain
@@ -13,11 +15,17 @@ def configure(self):
1315
cmake.user_presets_path = None
1416
if self.settings.get_safe('arch') == 'armv7':
1517
self.requires = conans.model.requires.Requirements(['fmt/10.0.0', 'sml/1.1.6'])
18+
return
19+
20+
if os.getenv("DONT_CONFIGURE_QT"):
21+
requirement = ['catch2/3.4.0', 'gtest/1.14.0', 'docopt.cpp/0.6.3',
22+
'spdlog/1.12.0', 'sml/1.1.8', 'nlohmann_json/3.11.2',
23+
'boost/1.83.0', 'crowcpp-crow/1.0+5', 'cppzmq/4.9.0',
24+
'protobuf/3.21.12']
25+
self.requires = conans.model.requires.Requirements(requirement)
1626
else:
17-
self.requires = conans.model.requires.Requirements(['catch2/3.4.0', 'gtest/1.14.0', 'docopt.cpp/0.6.3',
18-
'spdlog/1.12.0', 'sml/1.1.8', 'nlohmann_json/3.11.2',
19-
'boost/1.83.0', 'crowcpp-crow/1.0+5', 'cppzmq/4.9.0',
20-
'protobuf/3.21.12', 'qt/6.6.1'])
27+
self.requires = conans.model.requires.Requirements(['catch2/3.4.0', 'docopt.cpp/0.6.3', 'gtest/1.14.0',
28+
'qt/6.6.1', 'spdlog/1.12.0'])
2129

2230
def build(self):
2331
cmake = CMakeToolchain(self)

src/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ IF(CPP_STARTER_USE_CPPZMQ_PROTO)
3030
ADD_SUBDIRECTORY(protobuf.cppzmq)
3131
ENDIF()
3232

33+
# QT example
34+
IF(CPP_STARTER_USE_QT)
35+
MESSAGE("Using QT")
36+
ADD_SUBDIRECTORY(qt)
37+
ENDIF()
38+
3339

3440
FIND_PACKAGE(docopt REQUIRED)
3541
FIND_PACKAGE(spdlog REQUIRED)

0 commit comments

Comments
 (0)