aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/shapes
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/shapes
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/shapes')
-rw-r--r--examples/quick/shapes/CMakeLists.txt13
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/quick/shapes/CMakeLists.txt b/examples/quick/shapes/CMakeLists.txt
index 994befa0f3..5c6348ab04 100644
--- a/examples/quick/shapes/CMakeLists.txt
+++ b/examples/quick/shapes/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(shapes LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,18 +12,17 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/shapes")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
+qt_standard_project_setup()
+
add_subdirectory("../shared" "shared")
qt_add_executable(shapesexample
+ WIN32
+ MACOSX_BUNDLE
main.cpp
)
-set_target_properties(shapesexample PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(shapesexample PUBLIC
+target_link_libraries(shapesexample PRIVATE
Qt::Core
Qt::Gui
Qt::Qml