Skip to content

Commit 50db3f6

Browse files
committed
CMake: silence warning configuring examples
When configuring qtwebengine as its own module, Svg is not searched as an optional component, leading to the warning in examples/pdf/CMakeLists.txt always being printed even when QtSvg is available. Add Svg as an optional package in find_package and move the checks into the individual examples so the warning will also appear when the individual example is built. Pick-to: 6.8 6.9 Change-Id: I387dfd70ae1abc1a70f28dbfe74ac45b75bdf387 Reviewed-by: Michal Klocek <[email protected]>
1 parent 5c5cf99 commit 50db3f6

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

examples/pdf/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@
33

44
qt_internal_add_example(singlepage)
55
qt_internal_add_example(multipage)
6-
if(NOT TARGET Qt::Svg)
7-
message(WARNING "QtSvg is required as runtime dependency for qtpdfquick examples.")
8-
endif()

examples/pdf/multipage/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ endif()
1212

1313
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/pdf/multipage")
1414

15-
find_package(Qt6 REQUIRED COMPONENTS Gui Qml)
15+
find_package(Qt6 REQUIRED COMPONENTS Gui Qml OPTIONAL_COMPONENTS Svg)
16+
if(NOT TARGET Qt::Svg)
17+
message(WARNING "QtSvg is required as runtime dependency for qtpdfquick examples.")
18+
endif()
1619

1720
qt_add_executable(multipage
1821
main.cpp

examples/pdf/singlepage/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ endif()
1212

1313
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/pdf/singlepage")
1414

15-
find_package(Qt6 REQUIRED COMPONENTS Gui Qml)
15+
find_package(Qt6 REQUIRED COMPONENTS Gui Qml OPTIONAL_COMPONENTS Svg)
16+
if(NOT TARGET Qt::Svg)
17+
message(WARNING "QtSvg is required as runtime dependency for qtpdfquick examples.")
18+
endif()
1619

1720
qt_add_executable(pdfviewerquick
1821
main.cpp

0 commit comments

Comments
 (0)