summaryrefslogtreecommitdiffstats
path: root/util/cmake/pro2cmake.py
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-08-05 14:46:03 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-08-06 10:29:28 +0000
commita3e149d92a4c60ef9d96836499dd43c728592983 (patch)
tree175dfa128f7e5235819a35064194394e3726c135 /util/cmake/pro2cmake.py
parente343affd6345ef8db041789a96016c3a84830dc9 (diff)
Fix qml plugin conversion: always install qml files
Always install qml files regardless of whether the install_qml_files configuration is present in qmake. This was causing most unit tests to fail due to missing qml files. Change-Id: I53c7200cfa66805d0e459190ef105c1a73c34a5f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-xutil/cmake/pro2cmake.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 83bca8487a..f45de7edf3 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -1986,13 +1986,17 @@ def write_qml_plugin_qml_files(cm_fh: typing.IO[str],
qml_files = scope.get_files('QML_FILES', use_vpath=True)
if qml_files:
+ cm_fh.write('\n{}set(qml_files\n{}{}\n)\n'.format(
+ spaces(indent),
+ spaces(indent + 1),
+ '\n{}'.format(spaces(indent + 1)).join(qml_files)))
+
target_path = scope.get_string('TARGETPATH', inherit=True)
target_path_mangled = target_path.replace('/', '_')
target_path_mangled = target_path_mangled.replace('.', '_')
resource_name = 'qmake_' + target_path_mangled
prefix = '/qt-project.org/imports/' + target_path
- cm_fh.write('\n# QML Files\n')
- cm_fh.write('{}add_qt_resource({} {}\n{}PREFIX\n{}"{}"\n{}FILES\n{}{}\n)\n'.format(
+ cm_fh.write('\n{}add_qt_resource({} {}\n{}PREFIX\n{}"{}"\n{}FILES\n{}${{qml_files}}\n)\n'.format(
spaces(indent),
target,
resource_name,
@@ -2000,13 +2004,10 @@ def write_qml_plugin_qml_files(cm_fh: typing.IO[str],
spaces(indent + 2),
prefix,
spaces(indent + 1),
- spaces(indent + 2),
- '\n{}'.format(spaces(indent + 2)).join(qml_files)))
+ spaces(indent + 2)))
- if 'install_qml_files' in scope.get('CONFIG'):
- cm_fh.write('\nqt_install_qml_files({}\n FILES\n {}\n)\n\n'.format(
- target,
- '\n '.join(qml_files)))
+ cm_fh.write('\nqt_install_qml_files({}\n FILES ${{qml_files}}\n)\n\n'.format(
+ target))
def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *,