From 87078650a503477ddf63cf5656e4e82e9259ef56 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 12 Aug 2019 14:05:05 +0200 Subject: [PATCH] Wrap resource file paths in quotes This is required for paths that contain spaces, otherwise the .qrc file generated by the build system is invalid, and the RCC run fails at build time. Change-Id: I887100b08052b49dd7ea4dd92b94f357a7d9d16e Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index e47cba50ab..591bb84aa4 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -192,6 +192,9 @@ def write_add_qt_resource_call(target: str, resource_name: str, prefix: typing.O output += 'set_source_files_properties("{}"\n' \ ' PROPERTIES alias "{}"\n)\n'.format(full_source, alias) + # Quote file paths in case there are spaces. + sorted_files = ['"{}"'.format(f) for f in sorted_files] + if skip_qtquick_compiler: file_list = '\n '.join(sorted_files) output += 'set(resource_files\n {}\n)\n\n'.format(file_list) @@ -2137,6 +2140,10 @@ def write_qml_plugin_qml_files(cm_fh: typing.IO[str], qml_files = scope.get_files('QML_FILES', use_vpath=True) if qml_files: + + # Quote file paths in case there are spaces. + qml_files = ['"{}"'.format(f) for f in qml_files] + cm_fh.write('\n{}set(qml_files\n{}{}\n)\n'.format( spaces(indent), spaces(indent + 1),