Manage the PrintSupport dependencies on Cups correctly

Add the missing interface include directories to PrintSupportPrivate
and record the dependency on Cups package in PrintSupport if the
cups feature is enabled in UNIX systems. PrintSupport doens't require
the Cups library to be linked, but still rely on it's headers in the
private part.

Pick-to: 6.7 6.5
Fixes: QTBUG-126594
Change-Id: I9409fedc0f1e457ab740a40c18a04e31be074b02
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 30bb15e7bf42a07b49700b6e822513f125d9ed4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2024-06-24 12:49:32 +02:00 committed by Qt Cherry-pick Bot
parent 0608451392
commit d3caab52ef

View File

@ -89,6 +89,19 @@ qt_internal_extend_target(PrintSupport CONDITION QT_FEATURE_cups AND UNIX AND NO
kernel/qcups.cpp kernel/qcups_p.h
)
# qprint_p.h includes cups/ppd.h, so PrintSupportPrivate should add the related
# interface include path.
qt_internal_extend_target(PrintSupportPrivate CONDITION QT_FEATURE_cups AND UNIX AND NOT APPLE
PUBLIC_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:Cups::Cups,INTERFACE_INCLUDE_DIRECTORIES>
)
# Ensure that PrintSupport requires Cups if the 'cups' feature enabled and
# Cups is never linked.
if(QT_FEATURE_cups AND UNIX AND NOT APPLE)
qt_internal_add_target_include_dirs(PrintSupport Cups::Cups)
qt_record_extra_third_party_dependency(PrintSupport Cups::Cups)
endif()
qt_internal_extend_target(PrintSupport CONDITION QT_FEATURE_cupsjobwidget AND UNIX AND NOT APPLE
SOURCES
widgets/qcupsjobwidget.cpp widgets/qcupsjobwidget.ui widgets/qcupsjobwidget_p.h