cmake scripts: do not add spaces in empty lines

When adding resources inside a condition, we'd end up with lines
containing just spaces.

Change-Id: I623203d042e2492bdd72f97d8b9d90517040b0df
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Frederik Gladhorn 2019-10-23 09:50:58 +02:00
parent ccdbd32416
commit 61fa61ec16

View File

@ -1975,7 +1975,11 @@ def write_resources(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0,
str_indent = spaces(indent)
cm_fh.write(f"\n{str_indent}# Resources:\n")
for line in qrc_output.split("\n"):
cm_fh.write(f"{str_indent}{line}\n")
if line:
cm_fh.write(f"{str_indent}{line}\n")
else:
# do not add spaces to empty lines
cm_fh.write("\n")
def write_statecharts(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0, is_example=False):