From dd57f9900478cdec615e25660a9336f8c25ab043 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 11 Oct 2019 14:32:43 +0200 Subject: pro2cmake: Handle source files in example scopes Change-Id: I653801d6b13eb144719a4e6eac4779b1cd15e75c Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index eaef854f32..18855e66b4 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -2760,6 +2760,8 @@ def write_example( write_all_source_file_lists(cm_fh, scope, add_target, indent=0) cm_fh.write(")\n") + handling_first_scope = True + for scope in scopes: # write wayland already has condition scope handling write_wayland_part(cm_fh, binary_name, scope, indent=0) @@ -2773,6 +2775,10 @@ def write_example( cm_fh.write(f"\n{spaces(indent)}if({condition})\n") indent += 1 + if not handling_first_scope: + target_sources = f"target_sources({binary_name} PUBLIC" + write_all_source_file_lists(cm_fh, scope, target_sources, indent=indent, footer=")\n") + write_include_paths( cm_fh, scope, @@ -2817,6 +2823,7 @@ def write_example( if condition != "ON": indent -= 1 cm_fh.write(f"\n{spaces(indent)}endif()\n") + handling_first_scope = False if qmldir: write_qml_plugin_epilogue(cm_fh, binary_name, scope, qmldir, indent) -- cgit v1.2.3