build(grantlee): inject find_package(Qt6 Test REQUIRED) where Qt6::Test is used but no find_package present

This commit is contained in:
Copilot authored and Torsten Wierschin committed 2026-07-20 19:02:35 +02:00
1 parent a2931cb186
commit 74fc7a6d05
1 file changed
+12
+12
View File
@@ -66,6 +66,18 @@ for p in Path('.').rglob('*'):
print('Patched', p)
except Exception as e:
print('Skipping', p, 'error', e)
# ensure files linking to Qt6::Test have a find_package(Qt6 Test REQUIRED)
for p in Path('.').rglob('*'):
if p.is_file() and (p.name=='CMakeLists.txt' or p.suffix=='.cmake'):
try:
s = p.read_text()
if 'Qt6::Test' in s and 'find_package(Qt6 Test' not in s:
s = 'find_package(Qt6 Test REQUIRED)\n' + s
p.write_text(s)
print('Inserted find_package(Qt6 Test REQUIRED) in', p)
except Exception as e:
print('Skipping', p, 'error', e)
PY
popd >/dev/null