Skip to content

Commit 3908f2c

Browse files
committed
Install Qt charts module in CI
1 parent c66018b commit 3908f2c

3 files changed

Lines changed: 91 additions & 83 deletions

File tree

.github/workflows/linux-builds.yml

Lines changed: 85 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
workflow_dispatch:
66

7-
jobs:
7+
jobs:
88
build_ubuntu_2204_cmake:
99
runs-on: ubuntu-22.04
1010

@@ -13,72 +13,98 @@ jobs:
1313
QT_DIR: ${{ github.workspace }}/Qt
1414

1515
steps:
16-
- name: Checkout source
17-
uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0 # Fetch full history and tags
20-
21-
- name: Install dependencies
22-
run: |
23-
sudo apt-get update
24-
sudo apt-get install -y build-essential cmake ninja-build libgl1-mesa-dev libxkbcommon-x11-0 libx11-dev
25-
26-
- name: Install Qt
27-
uses: jurplel/install-qt-action@v3
28-
with:
29-
version: ${{ env.QT_VERSION }}
30-
target: desktop
31-
host: linux
32-
arch: gcc_64
33-
dir: ${{ env.QT_DIR }}
34-
setup-python: false
35-
36-
- name: Configure with CMake
37-
run: |
16+
- name: Checkout source
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Fetch full history and tags
20+
21+
- name: Install dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y \
25+
build-essential \
26+
cmake \
27+
ninja-build \
28+
libgl1-mesa-dev \
29+
libglu1-mesa-dev \
30+
libxkbcommon-x11-0 \
31+
libxkbcommon-dev \
32+
libx11-dev \
33+
libxcb1-dev \
34+
libxcb-render0-dev \
35+
libxcb-shape0-dev \
36+
libxcb-randr0-dev
37+
38+
- name: Install Qt
39+
uses: jurplel/install-qt-action@v3
40+
with:
41+
version: ${{ env.QT_VERSION }}
42+
target: desktop
43+
host: linux
44+
arch: gcc_64
45+
modules: 'qtcharts qtshadertools'
46+
dir: ${{ env.QT_DIR }}
47+
setup-python: false
48+
49+
- name: Configure with CMake
50+
run: |
3851
cmake -S . -B build \
3952
-DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}/Qt/${{ env.QT_VERSION }}/gcc_64" \
4053
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
4154
-DCMAKE_BUILD_TYPE=Release \
4255
-G Ninja
4356
44-
- name: Build
45-
run: cmake --build build
57+
- name: Build
58+
run: cmake --build build
4659

47-
- name: Run CMake install (optional)
48-
run: cmake --install build
60+
- name: Run CMake install (optional)
61+
run: cmake --install build
4962

5063
build_ubuntu_2204:
5164
runs-on: ubuntu-22.04
5265
steps:
53-
- uses: actions/checkout@v2
54-
- name: Cache Qt
55-
id: cache-qt-6-4
56-
uses: actions/cache@v3
57-
with:
58-
path: ../Qt/6.4.2
59-
key: ${{ runner.os }}-QtCache-Qt6-4
60-
61-
- name: Install Qt
62-
uses: jurplel/install-qt-action@v2
63-
with:
64-
version: '6.4.2'
65-
host: 'linux'
66-
target: 'desktop'
67-
install-deps: true
68-
cached: ${{ steps.cache-qt-6-4.outputs.cache-hit }}
69-
setup-python: true
70-
tools: ''
71-
tools-only: false
72-
73-
- name: Install needed xkbcommon symlink
74-
run: sudo apt-get install libxkbcommon-dev -y
75-
76-
- name: Ubuntu and Qt version
77-
run: |
78-
cat /etc/issue
79-
echo number of processors: $(nproc)
80-
qmake -v
81-
- name: qmake
82-
run: qmake
83-
- name: make
84-
run: make -j$(nproc)
66+
- uses: actions/checkout@v4
67+
68+
- name: Cache Qt
69+
id: cache-qt-6-4
70+
uses: actions/cache@v3
71+
with:
72+
path: ../Qt/6.4.2
73+
key: ${{ runner.os }}-QtCache-Qt6-4
74+
75+
- name: Install Qt
76+
uses: jurplel/install-qt-action@v3
77+
with:
78+
version: '6.4.2'
79+
host: 'linux'
80+
target: 'desktop'
81+
install-deps: true
82+
modules: 'qtcharts qtshadertools'
83+
cached: ${{ steps.cache-qt-6-4.outputs.cache-hit }}
84+
setup-python: true
85+
tools: ''
86+
tools-only: false
87+
88+
- name: Install dependencies (Charts + X11)
89+
run: |
90+
sudo apt-get update
91+
sudo apt-get install -y \
92+
libgl1-mesa-dev \
93+
libglu1-mesa-dev \
94+
libxkbcommon-dev \
95+
libxcb1-dev \
96+
libxcb-render0-dev \
97+
libxcb-shape0-dev \
98+
libxcb-randr0-dev
99+
100+
- name: Ubuntu and Qt version
101+
run: |
102+
cat /etc/issue
103+
echo number of processors: $(nproc)
104+
qmake -v
105+
106+
- name: qmake
107+
run: qmake
108+
109+
- name: make
110+
run: make -j$(nproc)

.github/workflows/windows-cmake.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
target: desktop
3030
host: windows
3131
arch: win64_msvc2019_64
32+
modules: 'qtcharts qtshadertools'
3233
dir: ${{ env.QT_DIR }}
3334
setup-python: false
3435

@@ -75,6 +76,7 @@ jobs:
7576
target: desktop
7677
host: windows
7778
arch: win64_mingw
79+
modules: 'qtcharts qtshadertools'
7880
dir: ${{ env.QT_DIR }}
7981
tools: 'tools_mingw1310'
8082
setup-python: false

examples/openGL/CMakeLists.txt

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22

33
project(OpenGLExample VERSION ${VERSION_SHORT})
44

@@ -7,7 +7,7 @@ set(CMAKE_AUTOMOC ON)
77
set(CMAKE_AUTORCC ON)
88

99
find_package(
10-
QT NAMES Qt6
10+
QT NAMES Qt6 Qt5
1111
COMPONENTS Core
1212
Gui
1313
Widgets
@@ -19,7 +19,7 @@ find_package(
1919
REQUIRED)
2020

2121
find_package(
22-
Qt${QT_VERSION_MAJOR}
22+
Qt${QT_VERSION_MAJOR} 5.5
2323
COMPONENTS Core
2424
Gui
2525
Widgets
@@ -54,6 +54,7 @@ target_link_libraries(${PROJECT_NAME}
5454

5555
qt_add_qml_module(
5656
${PROJECT_NAME}
57+
VERSION ${VERSION_SHORT}
5758
URI
5859
fbitem
5960
QML_FILES
@@ -112,24 +113,3 @@ target_include_directories(
112113
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/examples/openGL>
113114
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${INSTALL_NAME}>)
114115

115-
install(
116-
TARGETS ${PROJECT_NAME}
117-
BUNDLE DESTINATION .
118-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
119-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
120-
121-
qt_generate_deploy_app_script(TARGET ${PROJECT_NAME} OUTPUT_SCRIPT
122-
deploy_script NO_UNSUPPORTED_PLATFORM_ERROR)
123-
124-
install(SCRIPT ${deploy_script})
125-
126-
qt_generate_deploy_qml_app_script(
127-
TARGET
128-
${PROJECT_NAME}
129-
OUTPUT_SCRIPT
130-
qml_deploy_script
131-
MACOS_BUNDLE_POST_BUILD
132-
NO_UNSUPPORTED_PLATFORM_ERROR
133-
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM)
134-
135-
install(SCRIPT ${qml_deploy_script})

0 commit comments

Comments
 (0)