Mark Cups::Cups optional target when building for non-APPLE systems

Relax the dependency on Cups for PrintSupport module on non-APPLE
platforms. 30bb15e7bf42a07b49700b6e822513f125d9ed4d 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 30bb15e7bf42a07b49700b6e822513f125d9ed4d

Pick-to: 6.5 6.7 6.8
Change-Id: Ia31d52f7beb9fab6ffa5123147a243f5be6345ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2024-09-04 13:27:35 +02:00
parent 8b3865e151
commit cce81f296e
2 changed files with 13 additions and 3 deletions

View File

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

View File

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