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 9e96c38426

Change-Id: I9db1cbf0e6592c8c195d11b97b3eff40b1adbcbd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
bb10
Alexandru Croitor 2019-08-01 16:39:43 +02:00
parent cb370593df
commit 67bbb9179f
1 changed files with 4 additions and 1 deletions

View File

@ -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: