Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b840d2a
Revert part of r91 preventing QFlags from being wrapped
jcfr Jan 5, 2026
6a0ca0e
cmake: Re-enable CMake support importing historical improvements from…
jcfr Jul 2, 2025
325f05e
Fix Qt 5.15 failing to use 5.15 wrappers
jamesobutler Jul 7, 2025
2fb6272
Update PythonQtTestCleanup to adapt to this fork layout
jcfr Sep 1, 2025
a6e735b
cmake: Set PYTHONQT_SUPPORT_NAME_PROPERTY as target compile property
jcfr Oct 23, 2025
726cbfc
cmake: Set PYTHONQT_USE_RELEASE_PYTHON_FALLBACK as target compile pro…
jcfr Oct 23, 2025
cc6e3ca
cmake: Set include directories as target compile property
jcfr Oct 23, 2025
0a52825
cmake: Set PYTHONQT_DEBUG as target compile property
jcfr Oct 23, 2025
19f3c5e
cmake: Simplify Qt5 integration leveraging Qt5 imported targets
jcfr Oct 23, 2025
dec399c
cmake: Remove obsolete support for generated_cpp different from gener…
jcfr Oct 23, 2025
6724d4c
cmake: Remove support for building against Qt < 5.15
jcfr Oct 23, 2025
1db81c5
cmake: Update minimum required CMake version from 3.5 to 3.20.6
jcfr Oct 23, 2025
4a9d122
cmake: Switch to using FindPython3 CMake module
jcfr Oct 23, 2025
83a47ab
cmake: Add `PythonQtConfigure.h` to map CMake option to public macro
jcfr Oct 23, 2025
4a36f73
cmake: Simplify build-system leveraging AUTOMOC capability
jcfr Oct 23, 2025
c0aaaee
cmake/tests: fix PythonQt_QtAll exports and QtCore wrap handling
jcfr Oct 24, 2025
105f3ff
cmake: Prefer PythonQt_QtAll and remove PythonQt_QtBindings
jcfr Oct 24, 2025
f236d55
cmake(generator): Modernize generator build-system
jcfr Oct 30, 2025
00254c9
cmake: Remove obsolete comment
jcfr Oct 30, 2025
58d1fa0
cmake: Introduce PythonQt_GENERATED_PATH variable
jcfr Oct 30, 2025
c334970
cmake: Prefer using CorePrivate Qt target
jcfr Oct 31, 2025
a37e5c9
cmake: Add Qt6 support for building PythonQt and PythonQtGenerator
jcfr Oct 31, 2025
50bcd52
cmake: Simplify mapping of Qt wrapped library to component
jcfr Nov 6, 2025
7079172
cmake: Update Qt wrapped library to component mapping for Qt6
jcfr Nov 6, 2025
062f26a
cmake: Address build error by partially reverting AUTOMOC changes
jcfr Nov 6, 2025
d7d1576
cmake: Relax minimum required Qt version to support Ubuntu 24.04
jcfr Nov 9, 2025
d299be1
cmake: Suggest XmlPatterns as a build option only with Qt 5
jcfr Nov 10, 2025
1da46c7
cmake: Add 6.10 support (additional CorePrivate component)
codeling Nov 12, 2025
a02b4c3
CI: Add workflow for CMake build system\
jamesobutler Mar 29, 2026
436435c
CI: Remove undefined variable in qmake config
jamesobutler Mar 29, 2026
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
149 changes: 149 additions & 0 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: Build (CMake)

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
build:
strategy:
fail-fast: false
matrix:
os: ['ubuntu', 'windows']
# Qt 5.12.* is excluded: CMakeLists.txt requires Qt >= 5.15.0.
qt-version: [ '5.15.*', '6.10.*' ]
python-version: [ '3.12' ]
runs-on: ${{ matrix.os }}-latest
steps:

- name: Install MSVC
if: ${{ matrix.os == 'windows' }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- name: Install Qt ${{ matrix.qt-version }}
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
modules: ${{ startsWith(matrix.qt-version, '6') && 'qt5compat qtscxml qtpositioning qtwebchannel qtmultimedia qtwebengine' || '' }}
arch: ${{ (matrix.os == 'ubuntu' && (startsWith(matrix.qt-version, '5') && 'gcc_64' || 'linux_gcc_64')) || startsWith(matrix.qt-version, '6') && 'win64_msvc2022_64' || 'win64_msvc2019_64' }}

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: '${{ matrix.python-version }}'

- name: Checkout PythonQt
uses: actions/checkout@v6

- name: Ccache
if: ${{ matrix.os == 'ubuntu' }}
uses: hendrikmuhs/ccache-action@v1.2.20
with:
key: ${{ runner.os }}-cmake-${{ matrix.qt-version }}
evict-old-files: 'job'

- name: Set environment
id: setenv
run: |
QT_VERSION_MAJOR=$(cut -f 1 -d . <<< "${{ matrix.qt-version }}")
echo "QT_VERSION_MAJOR=$QT_VERSION_MAJOR" >> $GITHUB_ENV
QT_VERSION_SHORT=$(cut -f 1,2 -d . <<< "${{ matrix.qt-version }}")
echo "QT_VERSION_SHORT=$QT_VERSION_SHORT" >> $GITHUB_OUTPUT
PYTHON_VERSION_FULL=$(python --version 2>&1 | cut -f 2 -d ' ')
PYTHON_VERSION_SHORT=$(cut -f 1,2 -d . <<< $PYTHON_VERSION_FULL)
echo "PYTHON_VERSION_SHORT=$PYTHON_VERSION_SHORT" >> $GITHUB_OUTPUT
echo "$pythonLocation/bin" >> $GITHUB_PATH

- name: Build generator (Ubuntu)
if: ${{ matrix.os == 'ubuntu' }}
run: |
cmake -G Ninja -S generator -B generator/build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$QT_ROOT_DIR" \
-DPythonQtGenerator_QT_VERSION=$QT_VERSION_MAJOR
cmake --build generator/build

- name: Build generator (Windows)
if: ${{ matrix.os == 'windows' }}
shell: cmd
run: |
set QT_CMAKE_DIR=%QT_ROOT_DIR%\lib\cmake\Qt%QT_VERSION_MAJOR%
cmake -G "Visual Studio 17 2022" -S generator -B generator\build ^
"-DCMAKE_PREFIX_PATH=%QT_ROOT_DIR%;%QT_ROOT_DIR%\lib\cmake" ^
"-DQt%QT_VERSION_MAJOR%_DIR=%QT_CMAKE_DIR%" ^
-DPythonQtGenerator_QT_VERSION=%QT_VERSION_MAJOR% || exit /b 1
cmake --build generator\build --config Release || exit /b 1

- name: Generate Wrappers (Ubuntu)
if: ${{ matrix.os == 'ubuntu' }}
run: |
QTDIR="$QT_ROOT_DIR" \
UBSAN_OPTIONS="halt_on_error=1" \
ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
./generator/build/PythonQtGenerator \
--output-directory=.

- name: Generate Wrappers (Windows)
if: ${{ matrix.os == 'windows' }}
shell: cmd
run: |
set QTDIR=%QT_ROOT_DIR%
generator\build\Release\PythonQtGenerator.exe --output-directory=. || exit /b 1

- name: Upload Wrappers
uses: actions/upload-artifact@v7
with:
name: cmake_wrappers_${{ matrix.os }}_${{ steps.setenv.outputs.QT_VERSION_SHORT }}
path: generated_cpp
if-no-files-found: error

- name: Build and test PythonQt (Ubuntu)
if: ${{ matrix.os == 'ubuntu' }}
run: |
cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$QT_ROOT_DIR" \
-DPythonQt_QT_VERSION=$QT_VERSION_MAJOR \
"-DPythonQt_GENERATED_PATH=$(pwd)/generated_cpp" \
-DPythonQt_Wrap_QtCore=ON \
-DBUILD_TESTING=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
"-DCMAKE_CXX_FLAGS=-fsanitize=address,undefined -fno-sanitize-recover=undefined" \
"-DCMAKE_EXE_LINKER_FLAGS=-fsanitize=address,undefined" \
"-DCMAKE_SHARED_LINKER_FLAGS=-fsanitize=address,undefined"
cmake --build build --parallel $(nproc)
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
QT_QPA_PLATFORM=offscreen \
ctest --test-dir build --output-on-failure

- name: Build and test PythonQt (Windows)
if: ${{ matrix.os == 'windows' }}
shell: cmd
run: |
set QT_CMAKE_DIR=%QT_ROOT_DIR%\lib\cmake\Qt%QT_VERSION_MAJOR%
cmake -G "Visual Studio 17 2022" -S . -B build ^
"-DCMAKE_PREFIX_PATH=%QT_ROOT_DIR%;%QT_ROOT_DIR%\lib\cmake" ^
"-DQt%QT_VERSION_MAJOR%_DIR=%QT_CMAKE_DIR%" ^
-DPythonQt_QT_VERSION=%QT_VERSION_MAJOR% ^
"-DPythonQt_GENERATED_PATH=%CD%\generated_cpp" ^
-DPythonQt_Wrap_QtCore=ON ^
-DBUILD_TESTING=ON || exit /b 1
cmake --build build --config Release || exit /b 1
set PYTHONDEVMODE=1
set PYTHONASYNCIODEBUG=1
set PYTHONWARNINGS=error
set QT_QPA_PLATFORM=offscreen
ctest --test-dir build --output-on-failure -C Release || exit /b 1
1 change: 0 additions & 1 deletion .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ jobs:
python --version
qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^
CONFIG+=exclude_generator ^
"PYTHONQTALL_CONFIG=${{ matrix.pythonqtall-config }}" ^
"PYTHON_PATH=%pythonLocation%" ^
"PYTHON_VERSION=${{ steps.setenv.outputs.PYTHON_VERSION_SHORT }}" ^
PythonQt.pro
Expand Down
Loading
Loading