diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-07-16 14:22:37 +0200 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-07-18 08:05:58 +0000 |
commit | 3212f1b8662b5e5483a0185c22820e2d14593aba (patch) | |
tree | cd4fade474dd814609343a2e84c0c882db05d00b /util/cmake/pro2cmake.py | |
parent | 341ccc3b590d0a06157f29ce9237bc111e8cebf8 (diff) |
Add special case handling for corelib mimetypes resources
We have to treat the resources from mimetypes in corelibs specially
as they are reused for two test cases. Since we no longer use the qrc
files, we have wrapped the relevant code in a function that can be
called for every target that depends on it.
This change also corrects formatting for the generate CMake code
regarding resource commands.
Change-Id: I50a05c81151d75aefc9ca165f5ffeb9f5cd77162
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-x | util/cmake/pro2cmake.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 22b2d03219..5003faa370 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -132,18 +132,18 @@ def process_qrc_file(target: str, filepath: str, base_dir: str = '') -> str: if alias: full_source = os.path.join(base_dir, source) output += 'set_source_files_properties("{}"\n' \ - ' PROPERTIES alias "{}")\n'.format(full_source, alias) + ' PROPERTIES alias "{}"\n)\n'.format(full_source, alias) params = '' if lang: - params += ' LANG "{}"'.format(lang) + params += ' LANG\n "{}"\n'.format(lang) if prefix: - params += ' PREFIX "{}"'.format(prefix) + params += ' PREFIX\n "{}"\n'.format(prefix) if base_dir: - params += ' BASE "{}"'.format(base_dir) - output += 'add_qt_resource({} "{}"{} FILES\n {})\n'.format(target, full_resource_name, + params += ' BASE\n "{}"\n'.format(base_dir) + output += 'add_qt_resource({} "{}"\n{} FILES\n {}\n)\n'.format(target, full_resource_name, params, - '\n '.join(sorted_files)) + '\n '.join(sorted_files)) resource_count += 1 |