summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-02-10 17:03:01 +0100
committerMichal Klocek <michal.klocek@qt.io>2021-05-22 14:10:08 +0200
commitdd523573f2981cc58d4da0ec6e2b061a6172a8eb (patch)
tree77f190fbe00e111362711ce14be00117a3cb7a91 /examples/CMakeLists.txt
parente1e6e4c90071a7e4e7a12b9f529ca1da6d71e0c1 (diff)
Add examples to the cmake build
Add only quick and widget examples to the build for now. Update examples qmake files so the ci can also build qmake examples after the cmake bulid. Note this patch breakes qmake builds. Task-number: QTBUG-91760 Change-Id: Ia867a49bc3deab1967bdedcf525ad4afe3967c2a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r--examples/CMakeLists.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 000000000..6d366112c
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_minimum_required(VERSION 3.19)
+
+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
+)
+
+find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS WebEngineCore WebEngineWidgets WebEngineQuick)
+qt_build_repo_begin()
+qt_examples_build_begin()
+
+if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_quick_build)
+ add_subdirectory(webengine)
+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()