Skip to content

Commit

Permalink
Mark Cups::Cups optional target when building for non-APPLE systems
Browse files Browse the repository at this point in the history
Relax the dependency on Cups for PrintSupport module on non-APPLE
platforms. 30bb15e added the missing
dependency for the PrintSupportPrivate target, but made it required.
In general users not necessarly need the Cups found when linking
PrintSupport on non-APPLE platforms. So we may mark Cups optional.

We also need Cups as the required dependency when Qt is built
statically, since then QCupsPrinterSupportPlugin will require the
library to be found.

Amends 30bb15e

Pick-to: 6.5
Change-Id: Ia31d52f7beb9fab6ffa5123147a243f5be6345ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit cce81f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 848cc2b)
  • Loading branch information
semlanik authored and Qt Cherry-pick Bot committed Sep 29, 2024
1 parent 6daf427 commit aa70762
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/plugins/printsupport/cups/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

qt_find_package(Cups PROVIDED_TARGETS Cups::Cups)
if(NOT APPLE AND BUILD_SHARED_LIBS)
set(mark_cups_optional MARK_OPTIONAL)
else()
set(mark_cups_optional "")
endif()
qt_find_package(Cups PROVIDED_TARGETS Cups::Cups ${mark_cups_optional})

#####################################################################
## QCupsPrinterSupportPlugin Plugin:
Expand Down
9 changes: 7 additions & 2 deletions src/printsupport/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@

#### Libraries

qt_find_package(Cups PROVIDED_TARGETS Cups::Cups MODULE_NAME printsupport QMAKE_LIB cups)

if(NOT APPLE AND BUILD_SHARED_LIBS)
set(mark_cups_optional MARK_OPTIONAL)
else()
set(mark_cups_optional "")
endif()
qt_find_package(Cups PROVIDED_TARGETS Cups::Cups
MODULE_NAME printsupport QMAKE_LIB cups ${mark_cups_optional})

#### Tests

Expand Down

0 comments on commit aa70762

Please sign in to comment.