From 67bbb9179f28df8696548af52e6edf24c914ebd2 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 1 Aug 2019 16:39:43 +0200 Subject: [PATCH] Fix pro2cmake to handle QT default values properly Setting the "QT" SetOperation which defaults to "core" and "gui", should only be done once on the top-level .pro scope. To distinguish the top level scope, we need to check for both an empty parent_scope and an empty base_dir. Amends 9e96c384261ca1329d3143295d013701eb85b186 Change-Id: I9db1cbf0e6592c8c195d11b97b3eff40b1adbcbd Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 843b2e7bac..cf55bc76b6 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -387,7 +387,10 @@ class Scope(object): parent_scope._add_child(self) else: self._parent = None # type: typing.Optional[Scope] - self._operations['QT'] = [SetOperation(['core', 'gui'])] + # Only add the "QT = core gui" Set operation once, on the + # very top-level .pro scope, aka it's basedir is empty. + if not base_dir: + self._operations['QT'] = [SetOperation(['core', 'gui'])] self._basedir = base_dir if file: