CMake: pro2cmake.py: Fix handling of TEMPLATE=subdir .pro-files

Change-Id: I52f575df199c4d9b38123ab5d838f2e85344835d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
This commit is contained in:
Tobias Hunger 2019-02-13 09:13:37 +01:00
parent 8c04d6c967
commit 22dc78f417

View File

@ -676,7 +676,6 @@ def map_condition(condition: str) -> str:
def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *,
indent: int = 0) -> None:
assert scope.TEMPLATE == 'subdirs'
ind = ' ' * indent
for sd in scope.get('SUBDIRS', []):
full_sd = os.path.join(scope.basedir, sd)
@ -697,7 +696,7 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *,
else:
print(' XXXX: SUBDIR {} in {}: Not found.'.format(sd, scope))
for c in scope.children():
for c in scope.children:
cond = c.condition
if cond == 'else':
cm_fh.write('\n{}else()\n'.format(ind))