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.

Task-number: QTBUG-112300
Change-Id: I036beb961fe474ff060f93c98f5e2bda58e66f71
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 454b1de22c77b7c4917dfa9d6182b4ea80b49dc5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Joerg Bornemann 2023-03-27 15:06:42 +02:00 committed by Qt Cherry-pick Bot
parent a95f8f9cb3
commit 122c825022

View File

@ -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
)