Examples: Remove duplicated Qt6::PrintSupport link information

Some CMakeLists.txt files did link to Qt6::PrintSupport twice. Also
unify formatting and order of the linker step.

Change-Id: I4af935c5dc3de6c243aad8511b0803ceaa872589
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Kai Köhne 2022-11-15 22:50:53 +01:00
parent de7287be69
commit d221ea609f
11 changed files with 11 additions and 57 deletions

View File

@ -53,9 +53,7 @@ qt_add_resources(chip "images"
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(chip PUBLIC
Qt6::PrintSupport
)
target_link_libraries(chip PUBLIC Qt6::PrintSupport)
endif()
install(TARGETS chip

View File

@ -35,6 +35,10 @@ target_link_libraries(pixelator PUBLIC
Qt6::Widgets
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(pixelator PUBLIC Qt6::PrintSupport)
endif()
# Resources:
set(images_resource_files
"images/qt.png"
@ -47,12 +51,6 @@ qt_add_resources(pixelator "images"
${images_resource_files}
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(pixelator PUBLIC
Qt6::PrintSupport
)
endif()
install(TARGETS pixelator
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"

View File

@ -52,12 +52,6 @@ qt_add_resources(spreadsheet "spreadsheet"
${spreadsheet_resource_files}
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(spreadsheet PUBLIC
Qt6::PrintSupport
)
endif()
install(TARGETS spreadsheet
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"

View File

@ -52,12 +52,6 @@ qt_add_resources(dockwidgets "dockwidgets"
${dockwidgets_resource_files}
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(dockwidgets PUBLIC
Qt6::PrintSupport
)
endif()
install(TARGETS dockwidgets
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"

View File

@ -35,9 +35,7 @@ target_link_libraries(fontsampler PUBLIC
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(fontsampler PUBLIC
Qt6::PrintSupport
)
target_link_libraries(fontsampler PUBLIC Qt6::PrintSupport)
endif()
install(TARGETS fontsampler

View File

@ -32,9 +32,7 @@ target_link_libraries(orderform PUBLIC
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(orderform PUBLIC
Qt6::PrintSupport
)
target_link_libraries(orderform PUBLIC Qt6::PrintSupport)
endif()
install(TARGETS orderform

View File

@ -98,12 +98,6 @@ qt_add_resources(textedit "textedit"
${textedit_resource_files}
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(textedit PUBLIC
Qt6::PrintSupport
)
endif()
install(TARGETS textedit
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"

View File

@ -38,12 +38,6 @@ if (TARGET Qt6::PrintSupport)
target_link_libraries(fingerpaint PUBLIC Qt6::PrintSupport)
endif()
if(TARGET Qt6::PrintSupport)
target_link_libraries(fingerpaint PUBLIC
Qt6::PrintSupport
)
endif()
install(TARGETS fingerpaint
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"

View File

@ -33,6 +33,10 @@ target_link_libraries(notepad PUBLIC
Qt6::Widgets
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(notepad PUBLIC Qt6::PrintSupport)
endif()
# Resources:
set(notepad_resource_files
"images/bold.png"
@ -62,12 +66,6 @@ qt_add_resources(notepad "notepad"
${notepad_resource_files}
)
if(TARGET Qt6::PrintSupport)
target_link_libraries(notepad PUBLIC
Qt6::PrintSupport
)
endif()
install(TARGETS notepad
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"

View File

@ -37,12 +37,6 @@ if (TARGET Qt6::PrintSupport)
target_link_libraries(imageviewer PUBLIC Qt6::PrintSupport)
endif()
if(TARGET Qt6::PrintSupport)
target_link_libraries(imageviewer PUBLIC
Qt6::PrintSupport
)
endif()
install(TARGETS imageviewer
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"

View File

@ -38,12 +38,6 @@ if (TARGET Qt6::PrintSupport)
target_link_libraries(scribble PUBLIC Qt6::PrintSupport)
endif()
if(TARGET Qt6::PrintSupport)
target_link_libraries(scribble PUBLIC
Qt6::PrintSupport
)
endif()
install(TARGETS scribble
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"