Properly convert default QT directive

If unset QT by default has value: "core gui". This patch adds this
behavior by pre-defining the value in the root scope.

qmimedata CMakeList.txt was re-generated.

Change-Id: Ib8b6064bc46c72d829e0077d09f21bbfb494e137
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Jędrzej Nowacki 2019-07-04 14:48:32 +02:00 committed by Alexandru Croitor
parent b26b1455d7
commit 9e96c38426
3 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,7 @@ add_subdirectory(qmetaproperty)
# add_subdirectory(qmetatype)
add_subdirectory(qmetaenum)
if(NOT ((NOT TARGET Qt::Gui)))
# add_subdirectory(qmimedata)
add_subdirectory(qmimedata)
endif()
if(NOT ((ANDROID OR APPLE_UIKIT) OR (NOT TARGET Qt::Network)))
# add_subdirectory(qobject)

View File

@ -7,6 +7,8 @@
add_qt_test(tst_qmimedata
SOURCES
tst_qmimedata.cpp
PUBLIC_LIBRARIES
Qt::Gui
)
#### Keys ignored in scope 1:.:.:qmimedata.pro:<TRUE>:

View File

@ -378,10 +378,12 @@ class Scope(object):
'QT_SOURCE_TREE': [SetOperation(['${QT_SOURCE_TREE}'])],
'QT_BUILD_TREE': [SetOperation(['${PROJECT_BUILD_DIR}'])],
}) -> None:
self._operations = copy.deepcopy(operations)
if parent_scope:
parent_scope._add_child(self)
else:
self._parent = None # type: typing.Optional[Scope]
self._operations['QT'] = [SetOperation(['core', 'gui'])]
self._basedir = base_dir
if file:
@ -398,7 +400,6 @@ class Scope(object):
self._condition = map_condition(condition)
self._children = [] # type: typing.List[Scope]
self._included_children = [] # type: typing.List[Scope]
self._operations = copy.deepcopy(operations)
self._visited_keys = set() # type: typing.Set[str]
self._total_condition = None # type: typing.Optional[str]