From decce2cd76cefeaf86df796b16ebf1fecd6947bb Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Wed, 9 Oct 2019 14:10:12 +0200 Subject: [PATCH] Extract public/private libraries from scope for Examples Public/public libraries were always processed from the global scope. Change-Id: I1223f04f100f91790ced1da41fda2fb9b52c5987 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index c24aab59ba0..cf823c9f942 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -3033,9 +3033,12 @@ def write_example( write_defines( cm_fh, scope, f"target_compile_definitions({binary_name} PUBLIC", indent=indent, footer=")" ) + + (scope_public_libs, scope_private_libs) = extract_cmake_libraries(scope) + write_list( cm_fh, - private_libs, + scope_private_libs, "", indent=indent, header=f"target_link_libraries({binary_name} PRIVATE\n", @@ -3043,7 +3046,7 @@ def write_example( ) write_list( cm_fh, - public_libs, + scope_public_libs, "", indent=indent, header=f"target_link_libraries({binary_name} PUBLIC\n",