From 9e96c384261ca1329d3143295d013701eb85b186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 4 Jul 2019 14:48:32 +0200 Subject: [PATCH] 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 Reviewed-by: Tobias Hunger --- tests/auto/corelib/kernel/CMakeLists.txt | 2 +- tests/auto/corelib/kernel/qmimedata/CMakeLists.txt | 2 ++ util/cmake/pro2cmake.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/kernel/CMakeLists.txt b/tests/auto/corelib/kernel/CMakeLists.txt index 4abddd700f0..511e4f39dbc 100644 --- a/tests/auto/corelib/kernel/CMakeLists.txt +++ b/tests/auto/corelib/kernel/CMakeLists.txt @@ -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) diff --git a/tests/auto/corelib/kernel/qmimedata/CMakeLists.txt b/tests/auto/corelib/kernel/qmimedata/CMakeLists.txt index dd1e049209b..7b373d6e6a4 100644 --- a/tests/auto/corelib/kernel/qmimedata/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qmimedata/CMakeLists.txt @@ -7,6 +7,8 @@ add_qt_test(tst_qmimedata SOURCES tst_qmimedata.cpp + PUBLIC_LIBRARIES + Qt::Gui ) #### Keys ignored in scope 1:.:.:qmimedata.pro:: diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 8dab147d54c..80c975cec19 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -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]