diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-06-23 18:21:24 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-06-24 15:49:35 +0000 |
commit | fd52a6fcb952ec5790e776fe1b97b47d6c5b6f89 (patch) | |
tree | 2a0fef78be0165066a9965e4de76222b03f474a4 /util | |
parent | a64172015133b7d9a1102f2f837c535e801b1192 (diff) |
pro2cmake.py: Parse qmldir import statements with versions
You can write the following in a qmldir file these days:
import QtQuick auto
import QtQml 2.4
pro2cmake should understand and convert these to cmake.
Change-Id: Ica1728de0c8d7a0b2b5aa341d20e60b23dfa7fe1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/pro2cmake.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 441f8335e2..5f52c3218f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -681,7 +681,10 @@ class QmlDir: elif entries[0] == "designersupported": self.designer_supported = True elif entries[0] == "import": - self.imports.append(entries[1]) + if len(entries) == 3: + self.imports.append(entries[1] + "/" + entries[2]) + else: + self.imports.append(entries[1]) elif len(entries) == 3: self.handle_file(entries[0], entries[1], entries[2]) else: @@ -3399,7 +3402,7 @@ def write_example( raise RuntimeError( "Only qmldir import statements expected in conditional scope!" ) - import_list.append(qml_import[len("import ") :]) + import_list.append(qml_import[len("import ") :].replace(" ", "/")) if len(import_list) == 0: continue @@ -3703,7 +3706,7 @@ def write_qml_plugin( raise RuntimeError( "Only qmldir import statements expected in conditional scope!" ) - import_list.append(qml_import[len("import ") :]) + import_list.append(qml_import[len("import ") :].replace(" ", "/")) if len(import_list) == 0: continue |