Skip to content

Support latest Qt and test on Ubuntu 22.04 #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cucumber-cpp ubuntu-latest
name: cucumber-cpp ubuntu

on:
on:
pull_request:
branches: [ main ]
push:
Expand All @@ -16,16 +16,21 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com./en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest

strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: setup environment
run: |
sudo apt-get install libboost1.71-all-dev
sudo apt-get install libboost-all-dev
sudo apt-get install qtbase5-dev

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
Expand All @@ -37,7 +42,7 @@ jobs:

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

18 changes: 10 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,16 @@ if(CUKE_ENABLE_QT)
message(STATUS "C++11 is needed from Qt version 5.7.0, building with c++11 enabled")
set(CMAKE_CXX_STANDARD 11)
endif()
add_library(Qt::Core INTERFACE IMPORTED)
add_library(Qt::Gui INTERFACE IMPORTED)
add_library(Qt::Widgets INTERFACE IMPORTED)
add_library(Qt::Test INTERFACE IMPORTED)
set_target_properties(Qt::Core PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Core )
set_target_properties(Qt::Gui PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Gui )
set_target_properties(Qt::Widgets PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Widgets)
set_target_properties(Qt::Test PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Test )
if(Qt5Core_VERSION_STRING VERSION_LESS 5.15.0)
add_library(Qt::Core INTERFACE IMPORTED)
add_library(Qt::Gui INTERFACE IMPORTED)
add_library(Qt::Widgets INTERFACE IMPORTED)
add_library(Qt::Test INTERFACE IMPORTED)
set_target_properties(Qt::Core PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Core )
set_target_properties(Qt::Gui PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Gui )
set_target_properties(Qt::Widgets PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Widgets)
set_target_properties(Qt::Test PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Test )
endif()
else()
find_package(Qt4 COMPONENTS QtCore QtGui QtTest)
if(QT4_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion examples/CalcQt/src/CalculatorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <QPushButton>
#include <QSignalMapper>

CalculatorWidget::CalculatorWidget(QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) {
CalculatorWidget::CalculatorWidget(QWidget *parent) : QWidget(parent) {
QGridLayout *layout = new QGridLayout(this);
layout->setSizeConstraint(QLayout::SetFixedSize);
setLayout(layout);
Expand Down
2 changes: 1 addition & 1 deletion examples/CalcQt/src/CalculatorWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CalculatorWidget : public QWidget {

public:

CalculatorWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0);
CalculatorWidget(QWidget *parent = 0);

QString display();

Expand Down