Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
dlyr committed Jul 8, 2024
1 parent d91dd0c commit a06962e
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 12 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/push-master-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Master CI

on:
push:
branches:
- master


defaults:
run:
shell: bash

jobs:
main:
strategy:
fail-fast: false
matrix:
config:
- name: "Windows MSVC"
os: "windows-latest"
cc: "cl.exe"
cxx: "cl.exe"
icon: "Windows"
extra-flags: ""
- name: "Ubuntu gcc"
os: "ubuntu-latest"
cc: "gcc-10"
cxx: "g++-10"
icon: "Linux"
extra-flags: "-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations"
- name: "MacOS clang"
os: "macos-latest"
cc: "clang"
cxx: "clang++"
icon: "Apple"
extra-flags: "-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations"
build-type:
- "Release"
qtversion:
- name: "qt5"
value: "5.15.1"
- name: "qt6"
value: "6.2.0"
runs-on: ${{ matrix.os }}
steps:
- name: Install Ninja
shell: bash
run: ${{ runner.os == 'macOS' && 'brew install ninja' || runner.os == 'Windows' && 'choco install ninja' || 'sudo apt-get install ninja-build' }}
- name: Add msbuild to PATH
uses: seanmiddleditch/gha-setup-vsdevenv@master
if: runner.os == 'Windows'
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: install-qt-action-${{ matrix.config.name }}-${{ matrix.qtversion.value }}
version: ${{ matrix.qtversion.value }}
- name: Prepare directories
run: |
mkdir -p install/
mkdir -p master/
mkdir -p build/
- name: Checkout remote head
uses: actions/checkout@master
with:
path: master
- name: Configure
run: |
cd master
cmake -B ../build -DCMAKE_INSTALL_PREFIX=../install -GNinja -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_EXECUTE_PROCESS_COMMAND_ECHO=STDOUT
- name: Build
run: |
cmake --build build --target install --config ${{ matrix.build-type }}
26 changes: 15 additions & 11 deletions cmake/findQtPackage.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)

# Find Qt5 or Qt6 packages Parameters: COMPONENTS <component_list>: optional
# parameter listing the Qt packages (e.g. Core, Widgets REQUIRED: optional
Expand All @@ -23,20 +23,24 @@ macro(find_qt_package)
set(MY_OPTIONS_COMPONENTS "")
endif()

if(NOT QT_DEFAULT_MAJOR_VERSION OR QT_DEFAULT_MAJOR_VERSION STREQUAL "6")
if(${MY_OPTIONS_REQUIRED})
set(QT_SEARCH_MODE REQUIRED)
else()
set(QT_SEARCH_MODE QUIET)
endif()

if(QT_DEFAULT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6 COMPONENTS ${MY_OPTIONS_COMPONENTS} ${QT_SEARCH_MODE})
elseif(QT_DEFAULT_MAJOR_VERSION STREQUAL "5")
find_package(Qt5 5.15 COMPONENTS ${MY_OPTIONS_COMPONENTS} ${QT_SEARCH_MODE})
else() # QT_DEFAULT_MMAJOR_VERSION not set, first search 6, then 5.
find_package(
Qt6
COMPONENTS ${MY_OPTIONS_COMPONENTS}
QUIET)
endif()
if(NOT Qt6_FOUND)
if(${MY_OPTIONS_REQUIRED})
find_package(
Qt5 5.15
COMPONENTS ${MY_OPTIONS_COMPONENTS}
REQUIRED)
else()
find_package(Qt5 5.15 COMPONENTS ${MY_OPTIONS_COMPONENTS})
if(NOT Qt6_FOUND)
find_package(Qt5 5.15 COMPONENTS ${MY_OPTIONS_COMPONENTS}
${QT_SEARCH_MODE})
endif()
endif()
endmacro()
Expand Down
2 changes: 1 addition & 1 deletion src/PowerSliderPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,5 +323,5 @@ QString PowerSliderPlugin::domXml() const {
}

QString PowerSliderPlugin::includeFile() const {
return QLatin1String( "PowerSlider.hpp" );
return QLatin1String( "PowerSlider/PowerSlider.hpp" );
}

0 comments on commit a06962e

Please sign in to comment.