From a2931cb186292445cd39272d037efc11b37d5411 Mon Sep 17 00:00:00 2001 From: Copilot Date: Mon, 20 Jul 2026 19:01:54 +0200 Subject: [PATCH] build(grantlee): map find_package(Qt5 Test) -> find_package(Qt6 Test REQUIRED) to ensure Qt6::Test is available when tests link --- app/build_grantlee_qt6.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/build_grantlee_qt6.sh b/app/build_grantlee_qt6.sh index 7bf607be2..356e865e4 100755 --- a/app/build_grantlee_qt6.sh +++ b/app/build_grantlee_qt6.sh @@ -31,11 +31,14 @@ import re from pathlib import Path # first, convert find_package(Qt5 COMPONENTS ...) preserving components pat_fp = re.compile(r'find_package\s*\(\s*Qt5\s+COMPONENTS\s+([^\)]+)\)', re.M) +# map find_package(Qt5 Test) forms to Qt6 Test +pat_test_simple = re.compile(r'find_package\s*\(\s*Qt5\s+Test(?:\s+REQUIRED)?\s*\)', re.M) for p in Path('.').rglob('*'): if p.is_file() and (p.name=='CMakeLists.txt' or p.suffix=='.cmake'): try: s = p.read_text() s2 = pat_fp.sub(lambda m: 'find_package(Qt6 REQUIRED COMPONENTS %s)'%m.group(1).strip(), s) + s2 = pat_test_simple.sub('find_package(Qt6 Test REQUIRED)', s2) if s2 != s: p.write_text(s2) print('Patched find_package components in', p)