From 7024e7a62701f99dc2adf519ec2a3ce9d5d7920b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Thu, 2 Dec 2021 08:54:27 +0100 Subject: Examples: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiom Also consolidate several find_package(Qt6 ...) calls in one call. Task-number: QTBUG-98867 Change-Id: Idfd5e71f46d4489fac7411cbfadb84437a0658f3 Reviewed-by: Alexey Edelev Reviewed-by: Edward Welbourne --- examples/widgets/painting/affine/CMakeLists.txt | 4 +--- examples/widgets/painting/basicdrawing/CMakeLists.txt | 4 +--- examples/widgets/painting/composition/CMakeLists.txt | 4 +--- examples/widgets/painting/concentriccircles/CMakeLists.txt | 4 +--- examples/widgets/painting/deform/CMakeLists.txt | 4 +--- examples/widgets/painting/fontsampler/CMakeLists.txt | 8 ++++---- examples/widgets/painting/gradients/CMakeLists.txt | 4 +--- examples/widgets/painting/imagecomposition/CMakeLists.txt | 4 +--- examples/widgets/painting/painterpaths/CMakeLists.txt | 4 +--- examples/widgets/painting/pathstroke/CMakeLists.txt | 4 +--- examples/widgets/painting/transformations/CMakeLists.txt | 4 +--- 11 files changed, 14 insertions(+), 34 deletions(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt index 8594017d30..04d06301b4 100644 --- a/examples/widgets/painting/affine/CMakeLists.txt +++ b/examples/widgets/painting/affine/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/affine") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(affine # special case begin diff --git a/examples/widgets/painting/basicdrawing/CMakeLists.txt b/examples/widgets/painting/basicdrawing/CMakeLists.txt index 74e05e2f5e..a53bf0dd64 100644 --- a/examples/widgets/painting/basicdrawing/CMakeLists.txt +++ b/examples/widgets/painting/basicdrawing/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/basicdrawing") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(basicdrawing main.cpp diff --git a/examples/widgets/painting/composition/CMakeLists.txt b/examples/widgets/painting/composition/CMakeLists.txt index a859340074..119524cf29 100644 --- a/examples/widgets/painting/composition/CMakeLists.txt +++ b/examples/widgets/painting/composition/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/composition") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(composition # special case begin diff --git a/examples/widgets/painting/concentriccircles/CMakeLists.txt b/examples/widgets/painting/concentriccircles/CMakeLists.txt index 6ed7822902..7bc7b44deb 100644 --- a/examples/widgets/painting/concentriccircles/CMakeLists.txt +++ b/examples/widgets/painting/concentriccircles/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/concentriccircles") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(concentriccircles circlewidget.cpp circlewidget.h diff --git a/examples/widgets/painting/deform/CMakeLists.txt b/examples/widgets/painting/deform/CMakeLists.txt index c95ae5f2f5..e6ad71bb25 100644 --- a/examples/widgets/painting/deform/CMakeLists.txt +++ b/examples/widgets/painting/deform/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/deform") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(deform # special case begin diff --git a/examples/widgets/painting/fontsampler/CMakeLists.txt b/examples/widgets/painting/fontsampler/CMakeLists.txt index 58c610cf1c..cb04d523bd 100644 --- a/examples/widgets/painting/fontsampler/CMakeLists.txt +++ b/examples/widgets/painting/fontsampler/CMakeLists.txt @@ -15,10 +15,10 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/fontsampler") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) -find_package(Qt6 COMPONENTS PrintSupport) +find_package(Qt6 + REQUIRED COMPONENTS Core Gui Widgets + OPTIONAL_COMPONENTS PrintSupport +) qt_add_executable(fontsampler main.cpp diff --git a/examples/widgets/painting/gradients/CMakeLists.txt b/examples/widgets/painting/gradients/CMakeLists.txt index 199389a47a..b1881f29a4 100644 --- a/examples/widgets/painting/gradients/CMakeLists.txt +++ b/examples/widgets/painting/gradients/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/gradients") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(gradients # special case begin diff --git a/examples/widgets/painting/imagecomposition/CMakeLists.txt b/examples/widgets/painting/imagecomposition/CMakeLists.txt index 902987ab64..3705d5100e 100644 --- a/examples/widgets/painting/imagecomposition/CMakeLists.txt +++ b/examples/widgets/painting/imagecomposition/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/imagecomposition") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(imagecomposition imagecomposer.cpp imagecomposer.h diff --git a/examples/widgets/painting/painterpaths/CMakeLists.txt b/examples/widgets/painting/painterpaths/CMakeLists.txt index d26906e2f9..6e8492d8c3 100644 --- a/examples/widgets/painting/painterpaths/CMakeLists.txt +++ b/examples/widgets/painting/painterpaths/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/painterpaths") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(painterpaths main.cpp diff --git a/examples/widgets/painting/pathstroke/CMakeLists.txt b/examples/widgets/painting/pathstroke/CMakeLists.txt index 2911a0f0e4..1e8053ac86 100644 --- a/examples/widgets/painting/pathstroke/CMakeLists.txt +++ b/examples/widgets/painting/pathstroke/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/pathstroke") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(pathstroke # special case begin diff --git a/examples/widgets/painting/transformations/CMakeLists.txt b/examples/widgets/painting/transformations/CMakeLists.txt index c756f77d61..20b6af6a63 100644 --- a/examples/widgets/painting/transformations/CMakeLists.txt +++ b/examples/widgets/painting/transformations/CMakeLists.txt @@ -15,9 +15,7 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/transformations") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) qt_add_executable(transformations main.cpp -- cgit v1.2.3