Skip to content

Commit

Permalink
Examples: Remove duplicated Qt6::PrintSupport link information
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kkoehne committed Nov 30, 2022
1 parent de7287b commit d221ea6
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 57 deletions.
4 changes: 1 addition & 3 deletions examples/widgets/graphicsview/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions examples/widgets/itemviews/pixelator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}"
Expand Down
6 changes: 0 additions & 6 deletions examples/widgets/itemviews/spreadsheet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 0 additions & 6 deletions examples/widgets/mainwindows/dockwidgets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 1 addition & 3 deletions examples/widgets/painting/fontsampler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions examples/widgets/richtext/orderform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions examples/widgets/richtext/textedit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 0 additions & 6 deletions examples/widgets/touch/fingerpaint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
10 changes: 4 additions & 6 deletions examples/widgets/tutorials/notepad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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}"
Expand Down
6 changes: 0 additions & 6 deletions examples/widgets/widgets/imageviewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 0 additions & 6 deletions examples/widgets/widgets/scribble/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit d221ea6

Please sign in to comment.