diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-08-09 12:47:55 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-08-09 11:50:11 +0000 |
commit | 95c27e325f47cff168a85c21b4b9e592168384f9 (patch) | |
tree | c70a0f84751a43c433b3e88c49f7e6ee4e63d1de /util | |
parent | aaec0726234f1e7eb23087b04426591b81307e5a (diff) |
Fix add_qt_resource behavior with regards to unspecified prefixes
This change makes the PREFIX parameter a required parameter if the
target does not specify a default. This way the behavior is clear when
reading the code: add_qt_resource() without PREFIX means it must come
frmo the target.
Change-Id: I79024e70e7b4d32a5164b93aa08ec9ff409b2d39
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/pro2cmake.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 794b2ec2ef..097ed38f06 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -152,7 +152,7 @@ def process_qrc_file(target: str, filepath: str, base_dir: str = '', project_fil for resource in root: assert(resource.tag == 'qresource') lang = resource.get('lang', '') - prefix = resource.get('prefix', '') + prefix = resource.get('prefix', '/') full_resource_name = resource_name + (str(resource_count) if resource_count > 0 else '') @@ -192,8 +192,7 @@ def process_qrc_file(target: str, filepath: str, base_dir: str = '', project_fil params = '' if lang: params += ' LANG\n "{}"\n'.format(lang) - if prefix: - params += ' PREFIX\n "{}"\n'.format(prefix) + params += ' PREFIX\n "{}"\n'.format(prefix) if base_dir: params += ' BASE\n "{}"\n'.format(base_dir) output += 'add_qt_resource({} "{}"\n{} FILES\n {}\n)\n'.format(target, full_resource_name, |