diff options
| author | Joerg Bornemann <[email protected]> | 2022-03-03 12:04:48 +0100 |
|---|---|---|
| committer | Joerg Bornemann <[email protected]> | 2022-03-08 03:45:29 +0100 |
| commit | 1c2f6d2aceeb218786fde0ee0cb2ffd207d1e0b1 (patch) | |
| tree | 9861350f85637412bb114407eb319c4a383944ad /util/cmake/pro2cmake.py | |
| parent | f5a8d70deedb4bb2270be1f1ded9ddd3c4071d41 (diff) | |
pro2cmake: Write only one find_package call for Qt packages
Task-number: QTBUG-96799
Change-Id: I1eb8ac05f360b74e5ae1217b5535a33227b5084b
Reviewed-by: Alexandru Croitor <[email protected]>
Diffstat (limited to 'util/cmake/pro2cmake.py')
| -rwxr-xr-x | util/cmake/pro2cmake.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 93e6e6efa67..46aa3dc6f63 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -3741,9 +3741,25 @@ def write_find_package_section( if info and info not in packages: packages.append(info) - # ind = spaces(indent) + qt_components: List[str] = [] + for p in filter(LibraryMapping.is_qt, packages): + if p.components is not None: + qt_components += p.components + if qt_components: + qt_components = sorted(qt_components) + qt_package = LibraryMapping( + "unknown", "Qt6", "unknown", extra=["REQUIRED"], components=qt_components + ) + cm_fh.write( + generate_find_package_info( + qt_package, + use_qt_find_package=False, + remove_REQUIRED_from_extra=False, + indent=indent, + ) + ) - for p in packages: + for p in itertools.filterfalse(LibraryMapping.is_qt, packages): cm_fh.write(generate_find_package_info(p, use_qt_find_package=False, indent=indent)) if packages: |
