summaryrefslogtreecommitdiffstats
path: root/util/cmake/pro2cmake.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-11 14:32:43 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-11 12:40:47 +0000
commitdd57f9900478cdec615e25660a9336f8c25ab043 (patch)
treede720e0a2b9b22e5b16766fdb1b06623db1dbc4c /util/cmake/pro2cmake.py
parent0a85f4f834d499ee4b4560c92db7516db898b76b (diff)
pro2cmake: Handle source files in example scopes
Change-Id: I653801d6b13eb144719a4e6eac4779b1cd15e75c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-xutil/cmake/pro2cmake.py7
1 files changed, 7 insertions, 0 deletions
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)