- Wrap FIND_PACKAGE(RTI) in IF(NOT TARGET RTI::nddsc) condition - Prevents placeholder targets from overwriting manually configured RTI:: targets - Manual configuration creates RTI:: targets when BUILD_RTI=ON and RTI found - FIND_PACKAGE only called as fallback when manual config doesn't create targets Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Entire-Checkpoint: 01M1CT3XSQXCX9RQR6WM9DG3GH
74 lines
2.3 KiB
Python
74 lines
2.3 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Fix QList includes - must stay in QtCore, not QtGui!
|
|
QList is a Core container class, not a Gui class.
|
|
"""
|
|
|
|
import os
|
|
import re
|
|
|
|
def fix_qlist_includes(filepath):
|
|
"""Fix QList includes - change QtGui/QList back to QtCore/QList"""
|
|
try:
|
|
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
|
content = f.read()
|
|
except Exception as e:
|
|
return 0
|
|
|
|
original = content
|
|
fixed_count = 0
|
|
|
|
# Fix QtGui/QList -> QtCore/QList
|
|
pattern = r'#include\s*<QtGui/QList>'
|
|
replacement = '#include <QtCore/QList>'
|
|
|
|
matches = re.findall(pattern, content)
|
|
if matches:
|
|
content = re.sub(pattern, replacement, content)
|
|
fixed_count = len(matches)
|
|
|
|
if fixed_count > 0 and content != original:
|
|
with open(filepath, 'w', encoding='utf-8') as f:
|
|
f.write(content)
|
|
|
|
return fixed_count
|
|
|
|
def main():
|
|
total_fixed = 0
|
|
files_fixed = 0
|
|
files_scanned = 0
|
|
|
|
# Search in Lts/ and include/ directories
|
|
search_dirs = ['qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts',
|
|
'qt-migration-legatus/qt6-after/qt6-migrated-legatus/include']
|
|
|
|
for search_dir in search_dirs:
|
|
if not os.path.exists(search_dir):
|
|
continue
|
|
|
|
for root, dirs, files in os.walk(search_dir):
|
|
# Skip build directories
|
|
dirs[:] = [d for d in dirs if d not in ['build', '.git']]
|
|
|
|
for file in files:
|
|
if not (file.endswith('.h') or file.endswith('.cpp') or
|
|
file.endswith('.hpp') or file.endswith('.cc') or
|
|
file.endswith('.cxx')):
|
|
continue
|
|
|
|
filepath = os.path.join(root, file)
|
|
files_scanned += 1
|
|
|
|
fixed = fix_qlist_includes(filepath)
|
|
if fixed > 0:
|
|
total_fixed += fixed
|
|
files_fixed += 1
|
|
print(f"Fixed {fixed} QList includes in {filepath}")
|
|
|
|
print(f"\n=== QList Include Fix Summary ===")
|
|
print(f"Files scanned: {files_scanned}")
|
|
print(f"Files fixed: {files_fixed}")
|
|
print(f"Total fixes: {total_fixed}")
|
|
|
|
if __name__ == '__main__':
|
|
main() |