Skip to content

Commit c79100e

Browse files
authored
Merge pull request #253 from ursfassler/test-also-on-ubuntu-22.04
Support latest Qt and test on Ubuntu 22.04
2 parents 15d73be + 93d98d3 commit c79100e

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

.github/workflows/ubuntu-latest.yml renamed to .github/workflows/ubuntu.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: cucumber-cpp ubuntu-latest
1+
name: cucumber-cpp ubuntu
22

3-
on:
3+
on:
44
pull_request:
55
branches: [ main ]
66
push:
@@ -16,16 +16,21 @@ jobs:
1616
# well on Windows or Mac. You can convert this to a matrix build if you need
1717
# cross-platform coverage.
1818
# See: https://docs.github.com./en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
19-
runs-on: ubuntu-latest
19+
20+
strategy:
21+
matrix:
22+
os: [ubuntu-22.04, ubuntu-20.04]
23+
24+
runs-on: ${{ matrix.os }}
2025

2126
steps:
2227
- uses: actions/checkout@v2
23-
28+
2429
- name: setup environment
2530
run: |
26-
sudo apt-get install libboost1.71-all-dev
31+
sudo apt-get install libboost-all-dev
2732
sudo apt-get install qtbase5-dev
28-
33+
2934
- name: Configure CMake
3035
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
3136
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
@@ -37,7 +42,7 @@ jobs:
3742

3843
- name: Test
3944
working-directory: ${{github.workspace}}/build
40-
# Execute tests defined by the CMake configuration.
45+
# Execute tests defined by the CMake configuration.
4146
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
4247
run: ctest -C ${{env.BUILD_TYPE}}
43-
48+

CMakeLists.txt

+10-8
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,16 @@ if(CUKE_ENABLE_QT)
242242
message(STATUS "C++11 is needed from Qt version 5.7.0, building with c++11 enabled")
243243
set(CMAKE_CXX_STANDARD 11)
244244
endif()
245-
add_library(Qt::Core INTERFACE IMPORTED)
246-
add_library(Qt::Gui INTERFACE IMPORTED)
247-
add_library(Qt::Widgets INTERFACE IMPORTED)
248-
add_library(Qt::Test INTERFACE IMPORTED)
249-
set_target_properties(Qt::Core PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Core )
250-
set_target_properties(Qt::Gui PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Gui )
251-
set_target_properties(Qt::Widgets PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Widgets)
252-
set_target_properties(Qt::Test PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Test )
245+
if(Qt5Core_VERSION_STRING VERSION_LESS 5.15.0)
246+
add_library(Qt::Core INTERFACE IMPORTED)
247+
add_library(Qt::Gui INTERFACE IMPORTED)
248+
add_library(Qt::Widgets INTERFACE IMPORTED)
249+
add_library(Qt::Test INTERFACE IMPORTED)
250+
set_target_properties(Qt::Core PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Core )
251+
set_target_properties(Qt::Gui PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Gui )
252+
set_target_properties(Qt::Widgets PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Widgets)
253+
set_target_properties(Qt::Test PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Test )
254+
endif()
253255
else()
254256
find_package(Qt4 COMPONENTS QtCore QtGui QtTest)
255257
if(QT4_FOUND)

examples/CalcQt/src/CalculatorWidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <QPushButton>
77
#include <QSignalMapper>
88

9-
CalculatorWidget::CalculatorWidget(QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) {
9+
CalculatorWidget::CalculatorWidget(QWidget *parent) : QWidget(parent) {
1010
QGridLayout *layout = new QGridLayout(this);
1111
layout->setSizeConstraint(QLayout::SetFixedSize);
1212
setLayout(layout);

examples/CalcQt/src/CalculatorWidget.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CalculatorWidget : public QWidget {
1010

1111
public:
1212

13-
CalculatorWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0);
13+
CalculatorWidget(QWidget *parent = 0);
1414

1515
QString display();
1616

0 commit comments

Comments
 (0)