From 61fa61ec164a57265c4d65d9292428f0050454a1 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 23 Oct 2019 09:50:58 +0200 Subject: [PATCH] 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 Reviewed-by: Simon Hausmann Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ace4f44da6..833a3e58bd 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -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):