diff options
-rw-r--r-- | util/cmake/helper.py | 2 | ||||
-rwxr-xr-x | util/cmake/pro2cmake.py | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 8f24a49d6b..97397e67ec 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -132,6 +132,7 @@ _qt_library_map = [ LibraryMapping('qmldebug', 'Qt5', 'Qt::QmlDebug', extra = ['COMPONENTS', 'QmlDebug']), LibraryMapping('qmldevtools', 'Qt5', 'Qt::QmlDevTools', extra = ['COMPONENTS', 'QmlDevTools']), LibraryMapping('qml', 'Qt5', 'Qt::Qml', extra = ['COMPONENTS', 'Qml']), + LibraryMapping('qmlmodels', 'Qt5', 'Qt::QmlModels', extra = ['COMPONENTS', 'QmlModels']), LibraryMapping('qmltest', 'Qt5', 'Qt::QuickTest', extra = ['COMPONENTS', 'QuickTest']), LibraryMapping('qtmultimediaquicktools', 'Qt5', 'Qt::MultimediaQuick', extra = ['COMPONENTS', 'MultimediaQuick']), LibraryMapping('quick3danimation', 'Qt5', 'Qt::3DQuickAnimation', extra = ['COMPONENTS', '3DQuickAnimation']), @@ -325,6 +326,7 @@ def map_qt_library(lib: str) -> str: platform_mapping = { 'win32': 'WIN32', + 'win': 'WIN32', 'unix': 'UNIX', 'darwin': 'APPLE', 'linux': 'LINUX', diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index e2625af266..b45f0e8805 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -523,7 +523,7 @@ class Scope(object): def children(self) -> typing.List['Scope']: result = list(self._children) for include_scope in self._included_children: - result += include_scope._children + result += include_scope.children return result def dump(self, *, indent: int = 0) -> None: @@ -891,6 +891,13 @@ def parseProFile(file: str, *, debug=False): def map_condition(condition: str) -> str: + # Some hardcoded cases that are too bothersome to generalize. + condition = re.sub(r'^qtConfig\(opengl\(es1\|es2\)\?\)$', + r'QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3', + condition) + condition = re.sub(r'^qtConfig\(opengl\.\*\)$', r'QT_FEATURE_opengl', condition) + condition = re.sub(r'^win\*$', r'win', condition) + condition = re.sub(r'\bif\s*\((.*?)\)', r'\1', condition) condition = re.sub(r'\bisEmpty\s*\((.*?)\)', r'\1_ISEMPTY', condition) condition = re.sub(r'\bcontains\s*\((.*?),\s*"?(.*?)"?\)', |