From 454b1de22c77b7c4917dfa9d6182b4ea80b49dc5 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 27 Mar 2023 15:06:42 +0200 Subject: [PATCH] CMake: build the shared plugin when building the plugandpaint target People expect that building the "main target" of an example builds all necessary subtargets as well. Add a dependency from plugandpaint to pnp_extrafilters. Pick-to: 6.5 Task-number: QTBUG-112300 Change-Id: I036beb961fe474ff060f93c98f5e2bda58e66f71 Reviewed-by: Alexandru Croitor Reviewed-by: Alexey Edelev --- examples/widgets/tools/plugandpaint/app/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt index 5ab3171284f..c0368e7ba20 100644 --- a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt +++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt @@ -19,7 +19,11 @@ target_link_libraries(plugandpaint PRIVATE pnp_basictools ) -if(NOT QT6_IS_SHARED_LIBS_BUILD) +if(QT6_IS_SHARED_LIBS_BUILD) + # Build the shared plugin too when building this example target. + add_dependencies(plugandpaint pnp_extrafilters) +else() + # Link the extrafilters plugin if Qt is built statically. target_link_libraries(plugandpaint PRIVATE pnp_extrafilters )