diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-02-14 19:48:21 +0100 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2022-02-25 10:41:12 +0100 |
commit | af8c62bc4a908f416dd92a49b6e0617e687c6dd7 (patch) | |
tree | 7fa02d56c5e6bca88e3b81008187ac13530003e6 /examples/webenginequick/minimal | |
parent | 170fc1c2cb43318817552f1a1bed42b5cdc6eb36 (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/webenginequick/minimal')
-rw-r--r-- | examples/webenginequick/minimal/CMakeLists.txt | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/examples/webenginequick/minimal/CMakeLists.txt b/examples/webenginequick/minimal/CMakeLists.txt index 9155ce040..e0cb66733 100644 --- a/examples/webenginequick/minimal/CMakeLists.txt +++ b/examples/webenginequick/minimal/CMakeLists.txt @@ -1,36 +1,31 @@ cmake_minimum_required(VERSION 3.16) project(minimal 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}/webenginequick/minimal-qml") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS WebEngineQuick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick) qt_add_executable(webengine-minimal-qml main.cpp ) + set_target_properties(webengine-minimal-qml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(webengine-minimal-qml PUBLIC Qt::Core Qt::Gui Qt::WebEngineQuick ) - # Resources: set(qml_resource_files "main.qml" |