summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets/printme/CMakeLists.txt
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 19:48:21 +0100
committerKai Köhne <kai.koehne@qt.io>2022-02-25 10:41:12 +0100
commitaf8c62bc4a908f416dd92a49b6e0617e687c6dd7 (patch)
tree7fa02d56c5e6bca88e3b81008187ac13530003e6 /examples/webenginewidgets/printme/CMakeLists.txt
parent170fc1c2cb43318817552f1a1bed42b5cdc6eb36 (diff)
Improve examples CMakeLists.txt
- Remove "# generated from xyz.pro" comment from pro2cmake - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Pick-to: 6.3 Change-Id: I09083474432ce171e8ee1e28120b062f2ef3c052 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/webenginewidgets/printme/CMakeLists.txt')
-rw-r--r--examples/webenginewidgets/printme/CMakeLists.txt14
1 files changed, 4 insertions, 10 deletions
diff --git a/examples/webenginewidgets/printme/CMakeLists.txt b/examples/webenginewidgets/printme/CMakeLists.txt
index ada0bf250..2c38103c1 100644
--- a/examples/webenginewidgets/printme/CMakeLists.txt
+++ b/examples/webenginewidgets/printme/CMakeLists.txt
@@ -1,31 +1,26 @@
cmake_minimum_required(VERSION 3.16)
project(printme LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/printme")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS WebEngineWidgets)
-find_package(Qt6 COMPONENTS PrintSupport)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui PrintSupport WebEngineWidgets)
qt_add_executable(printme
main.cpp
printhandler.cpp printhandler.h
)
+
set_target_properties(printme PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(printme PUBLIC
Qt::Core
Qt::Gui
@@ -33,7 +28,6 @@ target_link_libraries(printme PUBLIC
Qt::WebEngineWidgets
)
-
# Resources:
set(data_resource_files
"data/icon.svg"