summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r--examples/CMakeLists.txt47
1 files changed, 17 insertions, 30 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 5c6e1592d..e863dafaf 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,34 +1,21 @@
-cmake_minimum_required(VERSION 3.16)
-
-include(${CMAKE_CURRENT_LIST_DIR}/../.cmake.conf)
-
-project(QtWebEngineExamples
- VERSION "${QT_REPO_MODULE_VERSION}"
- DESCRIPTION "Qt WebEngine Examples"
- HOMEPAGE_URL "https://qt.io/"
- LANGUAGES CXX C
-)
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-# Make sure we use the fixed BASE argument of qt_add_resource.
-set(QT_USE_FIXED_QT_ADD_RESOURCE_BASE TRUE)
-
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
-find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS WebEngineCore WebEngineWidgets WebEngineQuick QuickControls2)
-qt_build_repo_begin()
-qt_examples_build_begin()
+cmake_minimum_required(VERSION 3.16)
-if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_quick_build)
- add_subdirectory(webengine)
+qt_examples_build_begin(EXTERNAL_BUILD)
+if(NOT CMAKE_CROSSCOMPILING) #QTBUG-86533
+ if(TARGET Qt::WebEngineCore)
+ add_subdirectory(webenginequick)
+ endif()
+ if(TARGET Qt::WebEngineWidgets)
+ add_subdirectory(webenginewidgets)
+ endif()
+ if(TARGET Qt::Pdf)
+ add_subdirectory(pdf)
+ endif()
+ if(TARGET Qt::PdfWidgets)
+ add_subdirectory(pdfwidgets)
+ endif()
endif()
-if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_widgets_build)
- add_subdirectory(webenginewidgets)
-endif()
-if(QT_FEATURE_qtpdf_build )
- add_subdirectory(pdf)
-endif()
-if(QT_FEATURE_qtpdf_build AND QT_FEATURE_pdf_widgets)
- add_subdirectory(pdfwidgets)
-endif()
-
qt_examples_build_end()
-qt_build_repo_end()