From 447c868a5df9aac84ae39989d09bc2b704940698 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 27 Sep 2019 15:10:50 +0200 Subject: [PATCH] CMake: Generate wayland protocol code for examples as well Task-number: QTBUG-78177 Change-Id: Id1c49013244e5ba51b99c1538b314181efe786fb Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index b842e9fcc30..a2ea6ce0bf8 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -2578,7 +2578,10 @@ def write_wayland_part(cm_fh: typing.IO[str], target: str, scope:Scope, indent: if len(client_sources) == 0 and len(server_sources) == 0: return - condition = map_to_cmake_condition(scope.total_condition) + condition = "ON" + if scope.total_condition: + condition = map_to_cmake_condition(scope.total_condition) + if condition != "ON": cm_fh.write(f"\n{spaces(indent)}if({condition})\n") indent += 1 @@ -2946,6 +2949,8 @@ def write_example( cm_fh.write(")\n") + write_wayland_part(cm_fh, binary_name, scope, indent=0) + write_include_paths( cm_fh, scope, f"target_include_directories({binary_name} PUBLIC", indent=0, footer=")" )