From d3caab52ef1228bcfb31305b956d08bf8fb2037b Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 24 Jun 2024 12:49:32 +0200 Subject: [PATCH] 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 (cherry picked from commit 30bb15e7bf42a07b49700b6e822513f125d9ed4d) Reviewed-by: Qt Cherry-pick Bot --- src/printsupport/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt index c24d04d2ce1..0e6e1cc012d 100644 --- a/src/printsupport/CMakeLists.txt +++ b/src/printsupport/CMakeLists.txt @@ -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 + $ +) +# 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