aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/window/CMakeLists.txt
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2023-01-11 09:38:15 +0100
committerOliver Eftevaag <oliver.eftevaag@qt.io>2023-01-16 16:16:47 +0100
commit7409c217e8691beae5cd195fc8a0e3479de1db77 (patch)
treeefc78a981321468cf0f698c67005529d44ea2978 /examples/quick/window/CMakeLists.txt
parent7b0b09d87c36dfc67f0488d1ad87d720f721dea4 (diff)
Quick examples: Modernize cmake files according to our guidelines
The following changes are made to the CMakeLists.txt files in all quick examples: - Use PRIVATE linkage when possible. - Use qt_standard_project_setup() - Set WIN32 and MACOSX_BUNDLE in qt_add_executable() instead of set_target_properties() Pick-to: 6.5 Change-Id: I18217585aec56794b327f103d6959879df59d68a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'examples/quick/window/CMakeLists.txt')
-rw-r--r--examples/quick/window/CMakeLists.txt21
1 files changed, 9 insertions, 12 deletions
diff --git a/examples/quick/window/CMakeLists.txt b/examples/quick/window/CMakeLists.txt
index 18c09aca59..294fd9cd53 100644
--- a/examples/quick/window/CMakeLists.txt
+++ b/examples/quick/window/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(window LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,15 +12,21 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/window")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
+qt_standard_project_setup()
+
add_subdirectory("../shared" "shared")
qt_add_executable(windowexample
+ WIN32
+ MACOSX_BUNDLE
main.cpp
)
-set_target_properties(windowexample PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
+target_link_libraries(windowexample PRIVATE
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
)
qt_add_qml_module(windowexample
@@ -36,13 +40,6 @@ qt_add_qml_module(windowexample
"window.qml"
)
-target_link_libraries(windowexample PRIVATE
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Quick
-)
-
add_dependencies(windowexample window_shared)
install(TARGETS windowexample