aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/localstorage/CMakeLists.txt
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2021-09-01 15:40:28 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-03 15:10:39 +0000
commitce546cdd8c0d8b5175af81e7cf7f06f9b56cfeed (patch)
tree5cbe853f922c8efc2d5cfea94a2cb7d45cc579ed /examples/quick/localstorage/CMakeLists.txt
parent3aea6644d47b82784b01b5268eda2fad8c28b5c9 (diff)
Fix localstorage example to use a QML module
Removing the directory 'localstorage' that is inside the top-level 'localstorage' directory, and moving the content one level up in the file hierarchy. Change-Id: I97cf1ff92be9860d9a92bce66c88af927618e2b0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b0e567e7e3927945c904e9a613af4b9064d70bc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick/localstorage/CMakeLists.txt')
-rw-r--r--examples/quick/localstorage/CMakeLists.txt46
1 files changed, 45 insertions, 1 deletions
diff --git a/examples/quick/localstorage/CMakeLists.txt b/examples/quick/localstorage/CMakeLists.txt
index 6a405efc81..1f5e60197b 100644
--- a/examples/quick/localstorage/CMakeLists.txt
+++ b/examples/quick/localstorage/CMakeLists.txt
@@ -1,3 +1,47 @@
# Generated from localstorage.pro.
-qt_internal_add_example(localstorage)
+cmake_minimum_required(VERSION 3.16)
+project(localstorage LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/localstorage")
+
+find_package(Qt6 COMPONENTS Core Gui Quick Qml)
+
+qt_add_executable(localstorageexample
+ WIN32
+ MACOSX_BUNDLE
+ main.cpp
+)
+
+qt_add_qml_module(localstorageexample
+ URI localstorage
+ VERSION 1.0
+ QML_FILES
+ "Database.js"
+ "Header.qml"
+ "MyDelegate.qml"
+ "MyModel.qml"
+ "localstorage.qml"
+ )
+
+target_link_libraries(localstorageexample PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+)
+
+install(TARGETS localstorageexample
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)