From 9d82f4bff8520c3f6db7790d9044c3dfc5cc84c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Thu, 20 Jan 2022 17:42:48 +0100 Subject: Improve examples CMakeLists.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove # generated from xyz.pro comment from pro2cmake - Remove "# special case" markers for pro2cmake - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Pick-to: 6.3 Change-Id: I0d6bfb06c4b25e9921d3d2bf31d977150f12b31b Reviewed-by: Qt CI Bot Reviewed-by: Jörg Bornemann --- examples/quick/CMakeLists.txt | 3 +-- examples/quick/animation/CMakeLists.txt | 17 ++++++--------- examples/quick/canvas/CMakeLists.txt | 16 +++++---------- examples/quick/customitems/CMakeLists.txt | 2 -- .../quick/customitems/dialcontrol/CMakeLists.txt | 15 ++++---------- examples/quick/customitems/flipable/CMakeLists.txt | 9 ++------ .../customitems/maskedmousearea/CMakeLists.txt | 15 ++++---------- .../quick/customitems/painteditem/CMakeLists.txt | 5 +++-- examples/quick/delegatechooser/CMakeLists.txt | 12 ++++------- examples/quick/draganddrop/CMakeLists.txt | 9 ++------ examples/quick/embeddedinwidgets/CMakeLists.txt | 9 +++----- examples/quick/externaldraganddrop/CMakeLists.txt | 14 +++---------- examples/quick/imageelements/CMakeLists.txt | 9 ++------ examples/quick/imageprovider/CMakeLists.txt | 15 ++++---------- .../quick/imageresponseprovider/CMakeLists.txt | 15 ++++---------- examples/quick/keyinteraction/CMakeLists.txt | 7 +++---- examples/quick/layouts/CMakeLists.txt | 9 ++------ examples/quick/localstorage/CMakeLists.txt | 9 ++------ examples/quick/models/CMakeLists.txt | 2 -- .../quick/models/abstractitemmodel/CMakeLists.txt | 11 +++------- .../quick/models/objectlistmodel/CMakeLists.txt | 11 +++------- .../quick/models/stringlistmodel/CMakeLists.txt | 11 +++------- examples/quick/mousearea/CMakeLists.txt | 8 +++----- examples/quick/particles/CMakeLists.txt | 2 -- examples/quick/particles/affectors/CMakeLists.txt | 8 +++----- examples/quick/particles/emitters/CMakeLists.txt | 8 +++----- .../quick/particles/imageparticle/CMakeLists.txt | 8 +++----- .../quick/particles/itemparticle/CMakeLists.txt | 7 +++---- examples/quick/particles/system/CMakeLists.txt | 10 +++------ examples/quick/pointerhandlers/CMakeLists.txt | 9 +++----- examples/quick/positioners/CMakeLists.txt | 9 ++------ examples/quick/quick-accessibility/CMakeLists.txt | 15 ++++---------- examples/quick/quickwidgets/CMakeLists.txt | 2 -- .../qquickviewcomparison/CMakeLists.txt | 17 ++++----------- .../quick/quickwidgets/quickwidget/CMakeLists.txt | 16 ++++----------- examples/quick/rendercontrol/CMakeLists.txt | 2 -- .../rendercontrol_d3d11/CMakeLists.txt | 10 +++------ .../rendercontrol_opengl/CMakeLists.txt | 7 +++---- examples/quick/righttoleft/CMakeLists.txt | 9 ++------ examples/quick/scenegraph/CMakeLists.txt | 2 -- .../quick/scenegraph/customgeometry/CMakeLists.txt | 22 ++++++++------------ .../quick/scenegraph/custommaterial/CMakeLists.txt | 24 ++++++++-------------- .../quick/scenegraph/d3d11underqml/CMakeLists.txt | 15 ++++---------- examples/quick/scenegraph/fboitem/CMakeLists.txt | 15 ++++---------- examples/quick/scenegraph/graph/CMakeLists.txt | 14 ++++--------- .../scenegraph/metaltextureimport/CMakeLists.txt | 15 ++++---------- .../quick/scenegraph/metalunderqml/CMakeLists.txt | 15 ++++---------- .../quick/scenegraph/openglunderqml/CMakeLists.txt | 15 ++++---------- .../scenegraph/threadedanimation/CMakeLists.txt | 15 ++++---------- .../scenegraph/twotextureproviders/CMakeLists.txt | 16 ++++----------- .../scenegraph/vulkantextureimport/CMakeLists.txt | 15 ++++---------- .../quick/scenegraph/vulkanunderqml/CMakeLists.txt | 15 ++++---------- examples/quick/shadereffects/CMakeLists.txt | 17 ++++----------- examples/quick/shapes/CMakeLists.txt | 17 ++++++--------- examples/quick/shared/CMakeLists.txt | 1 + examples/quick/tableview/CMakeLists.txt | 2 -- examples/quick/tableview/gameoflife/CMakeLists.txt | 15 ++++---------- examples/quick/tableview/pixelator/CMakeLists.txt | 15 ++++---------- examples/quick/text/CMakeLists.txt | 17 ++++++--------- examples/quick/threading/CMakeLists.txt | 17 ++++++--------- examples/quick/touchinteraction/CMakeLists.txt | 17 ++++++--------- .../dynamicview/dynamicview1/CMakeLists.txt | 11 +++------- .../dynamicview/dynamicview2/CMakeLists.txt | 11 +++------- .../dynamicview/dynamicview3/CMakeLists.txt | 11 +++------- .../dynamicview/dynamicview4/CMakeLists.txt | 11 +++------- .../tutorials/samegame/samegame1/CMakeLists.txt | 11 +++------- .../tutorials/samegame/samegame2/CMakeLists.txt | 11 +++------- .../tutorials/samegame/samegame3/CMakeLists.txt | 11 +++------- .../tutorials/samegame/samegame4/CMakeLists.txt | 11 +++------- examples/quick/views/CMakeLists.txt | 17 ++++++--------- examples/quick/window/CMakeLists.txt | 16 +++++---------- 71 files changed, 234 insertions(+), 575 deletions(-) (limited to 'examples/quick') diff --git a/examples/quick/CMakeLists.txt b/examples/quick/CMakeLists.txt index e138f7039a..912849db9c 100644 --- a/examples/quick/CMakeLists.txt +++ b/examples/quick/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from quick.pro. - qt_internal_add_example(quick-accessibility) qt_internal_add_example(animation) qt_internal_add_example(draganddrop) @@ -61,6 +59,7 @@ set(reused_dir_targets system_shared draganddrop_shared ) + foreach(target IN LISTS reused_dir_targets) if(TARGET ${target}) qt_autogen_tools(${target} ENABLE_AUTOGEN_TOOLS moc rcc) diff --git a/examples/quick/animation/CMakeLists.txt b/examples/quick/animation/CMakeLists.txt index 29c6e184e0..b052e85778 100644 --- a/examples/quick/animation/CMakeLists.txt +++ b/examples/quick/animation/CMakeLists.txt @@ -1,40 +1,34 @@ -# Generated from animation.pro. - cmake_minimum_required(VERSION 3.16) project(animation LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/animation") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") qt_add_executable(animationexample main.cpp ) + set_target_properties(animationexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(animationexample PUBLIC Qt::Core Qt::Gui Qt::Qml Qt::Quick ) + add_dependencies(animationexample animation_shared) qt_add_qml_module(animationexample @@ -69,4 +63,5 @@ install(TARGETS animationexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(animationexample) diff --git a/examples/quick/canvas/CMakeLists.txt b/examples/quick/canvas/CMakeLists.txt index ff031fcc0a..4845cf5d82 100644 --- a/examples/quick/canvas/CMakeLists.txt +++ b/examples/quick/canvas/CMakeLists.txt @@ -1,34 +1,27 @@ -# Generated from canvas.pro. - cmake_minimum_required(VERSION 3.16) project(canvas LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/canvas") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") qt_add_executable(canvasexample main.cpp ) + set_target_properties(canvasexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(canvasexample PUBLIC Qt::Core Qt::Gui @@ -60,4 +53,5 @@ install(TARGETS canvasexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(canvasexample) diff --git a/examples/quick/customitems/CMakeLists.txt b/examples/quick/customitems/CMakeLists.txt index d52218f4e4..be00f5c7fb 100644 --- a/examples/quick/customitems/CMakeLists.txt +++ b/examples/quick/customitems/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from customitems.pro. - qt_internal_add_example(dialcontrol) qt_internal_add_example(painteditem) qt_internal_add_example(maskedmousearea) diff --git a/examples/quick/customitems/dialcontrol/CMakeLists.txt b/examples/quick/customitems/dialcontrol/CMakeLists.txt index dfc69c3c67..fbc08e0d63 100644 --- a/examples/quick/customitems/dialcontrol/CMakeLists.txt +++ b/examples/quick/customitems/dialcontrol/CMakeLists.txt @@ -1,32 +1,25 @@ -# Generated from dialcontrol.pro. - cmake_minimum_required(VERSION 3.16) project(dialcontrol LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/dialcontrol") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(dialcontrolexample main.cpp ) + set_target_properties(dialcontrolexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(dialcontrolexample PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/customitems/flipable/CMakeLists.txt b/examples/quick/customitems/flipable/CMakeLists.txt index 469cde10ee..f9b56f201b 100644 --- a/examples/quick/customitems/flipable/CMakeLists.txt +++ b/examples/quick/customitems/flipable/CMakeLists.txt @@ -1,21 +1,16 @@ -# Generated from flipable.pro. - cmake_minimum_required(VERSION 3.16) project(flipable 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/flipable") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(flipableexample WIN32 diff --git a/examples/quick/customitems/maskedmousearea/CMakeLists.txt b/examples/quick/customitems/maskedmousearea/CMakeLists.txt index afe52f0a9d..c0dfd705fe 100644 --- a/examples/quick/customitems/maskedmousearea/CMakeLists.txt +++ b/examples/quick/customitems/maskedmousearea/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from maskedmousearea.pro. - cmake_minimum_required(VERSION 3.16) project(maskedmousearea LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/maskedmousearea") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(maskedmousearea main.cpp maskedmousearea.cpp maskedmousearea.h ) + set_target_properties(maskedmousearea PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(maskedmousearea PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/customitems/painteditem/CMakeLists.txt b/examples/quick/customitems/painteditem/CMakeLists.txt index 8299de4882..d7903b4d15 100644 --- a/examples/quick/customitems/painteditem/CMakeLists.txt +++ b/examples/quick/customitems/painteditem/CMakeLists.txt @@ -5,12 +5,12 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/painteditem") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory(TextBalloon) @@ -29,6 +29,7 @@ target_link_libraries(painteditemexample PRIVATE Qt::Qml Qt::Quick ) + add_dependencies(painteditemexample qmltextballoon) install(TARGETS painteditemexample diff --git a/examples/quick/delegatechooser/CMakeLists.txt b/examples/quick/delegatechooser/CMakeLists.txt index 1c6abcff47..3b111119d3 100644 --- a/examples/quick/delegatechooser/CMakeLists.txt +++ b/examples/quick/delegatechooser/CMakeLists.txt @@ -1,21 +1,15 @@ -# Generated from delegatechooser.pro. - cmake_minimum_required(VERSION 3.16) project(delegatechooser LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/delegatechooser") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") @@ -27,6 +21,7 @@ target_link_libraries(delegatechooserexample PUBLIC Qt::Qml Qt::Quick ) + add_dependencies(delegatechooserexample delegatechooser_shared) qt_add_qml_module(delegatechooserexample @@ -41,4 +36,5 @@ install(TARGETS delegatechooserexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(delegatechooserexample) diff --git a/examples/quick/draganddrop/CMakeLists.txt b/examples/quick/draganddrop/CMakeLists.txt index dea3d2c27d..a969e420e5 100644 --- a/examples/quick/draganddrop/CMakeLists.txt +++ b/examples/quick/draganddrop/CMakeLists.txt @@ -1,20 +1,15 @@ -# Generated from draganddrop.pro. - cmake_minimum_required(VERSION 3.16) project(draganddrop 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/draganddrop") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") diff --git a/examples/quick/embeddedinwidgets/CMakeLists.txt b/examples/quick/embeddedinwidgets/CMakeLists.txt index 9f90d696b7..aedc1f8fc0 100644 --- a/examples/quick/embeddedinwidgets/CMakeLists.txt +++ b/examples/quick/embeddedinwidgets/CMakeLists.txt @@ -1,22 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(embeddedinwidgets 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/embeddedinwidgets") -find_package(Qt6 COMPONENTS Core Gui Widgets Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Widgets) qt_add_executable(embeddedinwidgetsexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(embeddedinwidgetsexample PRIVATE Qt::Core Qt::Gui @@ -24,7 +22,6 @@ target_link_libraries(embeddedinwidgetsexample PRIVATE Qt::Widgets ) - # Resources: qt_add_qml_module(embeddedinwidgetsexample URI embeddedinwidgets diff --git a/examples/quick/externaldraganddrop/CMakeLists.txt b/examples/quick/externaldraganddrop/CMakeLists.txt index a1ccea7936..08dd0276a0 100644 --- a/examples/quick/externaldraganddrop/CMakeLists.txt +++ b/examples/quick/externaldraganddrop/CMakeLists.txt @@ -1,28 +1,20 @@ -# Generated from externaldraganddrop.pro. - cmake_minimum_required(VERSION 3.16) project(externaldraganddrop LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/externaldraganddrop") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(externaldraganddropexample main.cpp ) + set_target_properties(externaldraganddropexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/imageelements/CMakeLists.txt b/examples/quick/imageelements/CMakeLists.txt index 425e8933bd..8e065a9a3e 100644 --- a/examples/quick/imageelements/CMakeLists.txt +++ b/examples/quick/imageelements/CMakeLists.txt @@ -1,20 +1,15 @@ -# Generated from imageelements.pro. - cmake_minimum_required(VERSION 3.16) project(imageelements 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/imageelements") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") diff --git a/examples/quick/imageprovider/CMakeLists.txt b/examples/quick/imageprovider/CMakeLists.txt index 56cffa33c5..950ec3f52b 100644 --- a/examples/quick/imageprovider/CMakeLists.txt +++ b/examples/quick/imageprovider/CMakeLists.txt @@ -1,25 +1,16 @@ -# Generated from imageprovider.pro. - cmake_minimum_required(VERSION 3.16) project(qmlimageproviderplugin LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/imageprovider/ImageProviderCore") set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/examples/quick/imageprovider) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt6_add_qml_module(qmlimageproviderplugin VERSION 1.0 @@ -33,10 +24,12 @@ qt6_add_qml_module(qmlimageproviderplugin target_sources(qmlimageproviderplugin PRIVATE imageprovider.cpp ) + set_target_properties(qmlimageproviderplugin PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(qmlimageproviderplugin PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/imageresponseprovider/CMakeLists.txt b/examples/quick/imageresponseprovider/CMakeLists.txt index 7f11e8ff86..af8fed133d 100644 --- a/examples/quick/imageresponseprovider/CMakeLists.txt +++ b/examples/quick/imageresponseprovider/CMakeLists.txt @@ -1,25 +1,16 @@ -# Generated from imageresponseprovider.pro. - cmake_minimum_required(VERSION 3.16) project(qmlimageresponseproviderplugin LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/imageresponseprovider/ImageResponseProviderCore") set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/examples/quick/imageresponseprovider) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt6_add_qml_module(qmlimageresponseproviderplugin VERSION 1.0 @@ -33,10 +24,12 @@ qt6_add_qml_module(qmlimageresponseproviderplugin target_sources(qmlimageresponseproviderplugin PRIVATE imageresponseprovider.cpp ) + set_target_properties(qmlimageresponseproviderplugin PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(qmlimageresponseproviderplugin PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/keyinteraction/CMakeLists.txt b/examples/quick/keyinteraction/CMakeLists.txt index e338c11024..24a1637547 100644 --- a/examples/quick/keyinteraction/CMakeLists.txt +++ b/examples/quick/keyinteraction/CMakeLists.txt @@ -1,21 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(keyinteraction LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/keyinteraction") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(keyinteractionexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(keyinteractionexample PRIVATE Qt::Core Qt::Gui diff --git a/examples/quick/layouts/CMakeLists.txt b/examples/quick/layouts/CMakeLists.txt index dc9bf06e66..143784dc82 100644 --- a/examples/quick/layouts/CMakeLists.txt +++ b/examples/quick/layouts/CMakeLists.txt @@ -1,20 +1,15 @@ -# Generated from layouts.pro. - cmake_minimum_required(VERSION 3.16) project(layouts 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/layouts") -find_package(Qt6 COMPONENTS Core Gui Qml Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(layoutsexample WIN32 diff --git a/examples/quick/localstorage/CMakeLists.txt b/examples/quick/localstorage/CMakeLists.txt index 1f5e60197b..cf453d8889 100644 --- a/examples/quick/localstorage/CMakeLists.txt +++ b/examples/quick/localstorage/CMakeLists.txt @@ -1,20 +1,15 @@ -# Generated from localstorage.pro. - 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/localstorage") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(localstorageexample WIN32 diff --git a/examples/quick/models/CMakeLists.txt b/examples/quick/models/CMakeLists.txt index d92f9e4a27..775c42cf33 100644 --- a/examples/quick/models/CMakeLists.txt +++ b/examples/quick/models/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from models.pro. - qt_internal_add_example(abstractitemmodel) qt_internal_add_example(objectlistmodel) qt_internal_add_example(stringlistmodel) diff --git a/examples/quick/models/abstractitemmodel/CMakeLists.txt b/examples/quick/models/abstractitemmodel/CMakeLists.txt index 486e6d376a..1851bbf102 100644 --- a/examples/quick/models/abstractitemmodel/CMakeLists.txt +++ b/examples/quick/models/abstractitemmodel/CMakeLists.txt @@ -1,25 +1,21 @@ -# Generated from abstractitemmodel.pro. - cmake_minimum_required(VERSION 3.16) project(abstractitemmodel 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/models/abstractitemmodel") -find_package(Qt6 COMPONENTS Core Gui Qml Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(abstractitemmodelexample WIN32 MACOSX_BUNDLE main.cpp model.cpp ) + target_link_libraries(abstractitemmodelexample PUBLIC Qt::Core Qt::Gui @@ -27,7 +23,6 @@ target_link_libraries(abstractitemmodelexample PUBLIC Qt::Quick ) - # Resources: qt_add_qml_module(abstractitemmodelexample URI abstractitemmodel diff --git a/examples/quick/models/objectlistmodel/CMakeLists.txt b/examples/quick/models/objectlistmodel/CMakeLists.txt index 8dbee3ae0b..dd48968f4c 100644 --- a/examples/quick/models/objectlistmodel/CMakeLists.txt +++ b/examples/quick/models/objectlistmodel/CMakeLists.txt @@ -1,25 +1,21 @@ -# Generated from objectlistmodel.pro. - cmake_minimum_required(VERSION 3.16) project(objectlistmodel 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/models/objectlistmodel") -find_package(Qt6 COMPONENTS Core Gui Qml Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(objectlistmodelexample WIN32 MACOSX_BUNDLE dataobject.cpp main.cpp ) + target_link_libraries(objectlistmodelexample PUBLIC Qt::Core Qt::Gui @@ -27,7 +23,6 @@ target_link_libraries(objectlistmodelexample PUBLIC Qt::Quick ) - # Resources: qt_add_qml_module(objectlistmodelexample URI objectlistmodel diff --git a/examples/quick/models/stringlistmodel/CMakeLists.txt b/examples/quick/models/stringlistmodel/CMakeLists.txt index 3bfb3ca4bf..1f72cf3b07 100644 --- a/examples/quick/models/stringlistmodel/CMakeLists.txt +++ b/examples/quick/models/stringlistmodel/CMakeLists.txt @@ -1,24 +1,20 @@ -# Generated from stringlistmodel.pro. - cmake_minimum_required(VERSION 3.16) project(stringlistmodel 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/models/stringlistmodel") -find_package(Qt6 COMPONENTS Core Gui Qml Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(stringlistmodelexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(stringlistmodelexample PUBLIC Qt::Core Qt::Gui @@ -26,7 +22,6 @@ target_link_libraries(stringlistmodelexample PUBLIC Qt::Quick ) - # Resources: qt_add_qml_module(stringlistmodelexample URI stringlistmodel diff --git a/examples/quick/mousearea/CMakeLists.txt b/examples/quick/mousearea/CMakeLists.txt index ea635462be..da36fd61ca 100644 --- a/examples/quick/mousearea/CMakeLists.txt +++ b/examples/quick/mousearea/CMakeLists.txt @@ -1,21 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(mousearea LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/mousearea") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(mouseareaexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(mouseareaexample PUBLIC Qt::Core Qt::Gui @@ -23,7 +22,6 @@ target_link_libraries(mouseareaexample PUBLIC Qt::Quick ) - # Resources: qt_add_qml_module(mouseareaexample URI mousearea diff --git a/examples/quick/particles/CMakeLists.txt b/examples/quick/particles/CMakeLists.txt index 3a9aca610a..a9fb838e99 100644 --- a/examples/quick/particles/CMakeLists.txt +++ b/examples/quick/particles/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from particles.pro. - qt_internal_add_example(affectors) qt_internal_add_example(emitters) qt_internal_add_example(imageparticle) diff --git a/examples/quick/particles/affectors/CMakeLists.txt b/examples/quick/particles/affectors/CMakeLists.txt index 9434063429..afbf286112 100644 --- a/examples/quick/particles/affectors/CMakeLists.txt +++ b/examples/quick/particles/affectors/CMakeLists.txt @@ -1,24 +1,22 @@ cmake_minimum_required(VERSION 3.16) project(affectors 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/affectors") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../../shared" "shared") qt_add_executable(affectorsexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(affectorsexample PRIVATE Qt::Core Qt::Gui diff --git a/examples/quick/particles/emitters/CMakeLists.txt b/examples/quick/particles/emitters/CMakeLists.txt index bf68c59cf5..1203de6b59 100644 --- a/examples/quick/particles/emitters/CMakeLists.txt +++ b/examples/quick/particles/emitters/CMakeLists.txt @@ -1,24 +1,22 @@ cmake_minimum_required(VERSION 3.16) project(emitters 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/emitters") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../../shared" "shared") qt_add_executable(emittersexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(emittersexample PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/particles/imageparticle/CMakeLists.txt b/examples/quick/particles/imageparticle/CMakeLists.txt index 387c5bdd41..41eab03f36 100644 --- a/examples/quick/particles/imageparticle/CMakeLists.txt +++ b/examples/quick/particles/imageparticle/CMakeLists.txt @@ -1,24 +1,22 @@ cmake_minimum_required(VERSION 3.16) project(imageparticle 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/imageparticle") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../../shared" "shared") qt_add_executable(imageparticleexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(imageparticleexample PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/particles/itemparticle/CMakeLists.txt b/examples/quick/particles/itemparticle/CMakeLists.txt index 6df338e00e..be5fa2fc03 100644 --- a/examples/quick/particles/itemparticle/CMakeLists.txt +++ b/examples/quick/particles/itemparticle/CMakeLists.txt @@ -1,23 +1,22 @@ cmake_minimum_required(VERSION 3.16) project(itemparticle LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/itemparticle") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../../shared" "shared") qt_add_executable(itemparticleexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(itemparticleexample PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/particles/system/CMakeLists.txt b/examples/quick/particles/system/CMakeLists.txt index c8ab118550..f6c975a128 100644 --- a/examples/quick/particles/system/CMakeLists.txt +++ b/examples/quick/particles/system/CMakeLists.txt @@ -1,26 +1,22 @@ -# Generated from system.pro. - cmake_minimum_required(VERSION 3.16) project(system 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/system") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../../shared" "shared") qt_add_executable(systemexample WIN32 MACOSX_BUNDLE main.cpp ) + target_link_libraries(systemexample PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/pointerhandlers/CMakeLists.txt b/examples/quick/pointerhandlers/CMakeLists.txt index 17c49848fa..0431092b95 100644 --- a/examples/quick/pointerhandlers/CMakeLists.txt +++ b/examples/quick/pointerhandlers/CMakeLists.txt @@ -1,19 +1,15 @@ -# Generated from pointer.pro. - cmake_minimum_required(VERSION 3.16) project(pointerhandlers LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/pointerhandlers") -find_package(Qt6 COMPONENTS Core Gui Quick Qml Svg) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Svg) add_subdirectory("../shared" "shared") @@ -85,4 +81,5 @@ install(TARGETS pointerhandlersexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(pointerhandlersexample) diff --git a/examples/quick/positioners/CMakeLists.txt b/examples/quick/positioners/CMakeLists.txt index e1c9639326..dd2ebca075 100644 --- a/examples/quick/positioners/CMakeLists.txt +++ b/examples/quick/positioners/CMakeLists.txt @@ -1,20 +1,15 @@ -# Generated from positioners.pro. - cmake_minimum_required(VERSION 3.16) project(positioners 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/positioners") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") diff --git a/examples/quick/quick-accessibility/CMakeLists.txt b/examples/quick/quick-accessibility/CMakeLists.txt index 04189a77a3..b53a04e8e7 100644 --- a/examples/quick/quick-accessibility/CMakeLists.txt +++ b/examples/quick/quick-accessibility/CMakeLists.txt @@ -1,32 +1,25 @@ -# Generated from quick-accessibility.pro. - cmake_minimum_required(VERSION 3.16) project(quick-accessibility LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/quick-accessibility") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(quick-accessibility main.cpp ) + set_target_properties(quick-accessibility PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(quick-accessibility PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/quickwidgets/CMakeLists.txt b/examples/quick/quickwidgets/CMakeLists.txt index 82deb9df2f..e0537e1e01 100644 --- a/examples/quick/quickwidgets/CMakeLists.txt +++ b/examples/quick/quickwidgets/CMakeLists.txt @@ -1,4 +1,2 @@ -# Generated from quickwidgets.pro. - qt_internal_add_example(quickwidget) qt_internal_add_example(qquickviewcomparison) diff --git a/examples/quick/quickwidgets/qquickviewcomparison/CMakeLists.txt b/examples/quick/quickwidgets/qquickviewcomparison/CMakeLists.txt index 428f7b53a3..2ac77c313c 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/CMakeLists.txt +++ b/examples/quick/quickwidgets/qquickviewcomparison/CMakeLists.txt @@ -1,26 +1,15 @@ -# Generated from qquickviewcomparison.pro. - cmake_minimum_required(VERSION 3.16) project(qquickviewcomparison LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/quickwidgets/qquickviewcomparison") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Widgets) -find_package(Qt6 COMPONENTS QuickWidgets) -find_package(Qt6 COMPONENTS ShaderTools) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick QuickWidgets ShaderTools Widgets) qt_add_executable(qquickviewcomparison fbitem.cpp fbitem.h @@ -28,10 +17,12 @@ qt_add_executable(qquickviewcomparison main.cpp mainwindow.cpp mainwindow.h ) + set_target_properties(qquickviewcomparison PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(qquickviewcomparison PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/quickwidgets/quickwidget/CMakeLists.txt b/examples/quick/quickwidgets/quickwidget/CMakeLists.txt index 5aeeb70505..f3cd7688c3 100644 --- a/examples/quick/quickwidgets/quickwidget/CMakeLists.txt +++ b/examples/quick/quickwidgets/quickwidget/CMakeLists.txt @@ -1,34 +1,26 @@ -# Generated from quickwidget.pro. - cmake_minimum_required(VERSION 3.16) project(quickwidget LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/quickwidgets/quickwidget") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Widgets) -find_package(Qt6 COMPONENTS QuickWidgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick QuickWidgets Widgets) qt_add_executable(quickwidget fbitem.cpp fbitem.h main.cpp ) + set_target_properties(quickwidget PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(quickwidget PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/rendercontrol/CMakeLists.txt b/examples/quick/rendercontrol/CMakeLists.txt index aa4cf774ee..885cdbf914 100644 --- a/examples/quick/rendercontrol/CMakeLists.txt +++ b/examples/quick/rendercontrol/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from rendercontrol.pro. - qt_internal_add_example(rendercontrol_opengl) if(WIN32) qt_internal_add_example(rendercontrol_d3d11) diff --git a/examples/quick/rendercontrol/rendercontrol_d3d11/CMakeLists.txt b/examples/quick/rendercontrol/rendercontrol_d3d11/CMakeLists.txt index 1851fba31d..e44f9f135c 100644 --- a/examples/quick/rendercontrol/rendercontrol_d3d11/CMakeLists.txt +++ b/examples/quick/rendercontrol/rendercontrol_d3d11/CMakeLists.txt @@ -1,25 +1,22 @@ -# Generated from rendercontrol_d3d11.pro. - cmake_minimum_required(VERSION 3.16) project(rendercontrol_d3d11 LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/rendercontrol/rendercontrol_d3d11") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(rendercontrol_d3d11example WIN32 MACOSX_BUNDLE engine.cpp main.cpp window.cpp ) + target_link_libraries(rendercontrol_d3d11example PUBLIC Qt::Core Qt::Gui @@ -31,7 +28,6 @@ target_link_libraries(rendercontrol_d3d11example PUBLIC uuid ) - # Resources: qt_add_qml_module(rendercontrol_d3d11example URI rendercontrol diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/CMakeLists.txt b/examples/quick/rendercontrol/rendercontrol_opengl/CMakeLists.txt index e15de24f08..77f4dc54f6 100644 --- a/examples/quick/rendercontrol/rendercontrol_opengl/CMakeLists.txt +++ b/examples/quick/rendercontrol/rendercontrol_opengl/CMakeLists.txt @@ -1,23 +1,22 @@ cmake_minimum_required(VERSION 3.16) project(rendercontrol_opengl LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/rendercontrol/rendercontrol_opengl") -find_package(Qt6 COMPONENTS Core Gui Quick Qml OpenGL) +find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL Qml Quick) qt_add_executable(rendercontrol_openglexample WIN32 MACOSX_BUNDLE cuberenderer.cpp main.cpp window_singlethreaded.cpp ) + target_link_libraries(rendercontrol_openglexample PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/righttoleft/CMakeLists.txt b/examples/quick/righttoleft/CMakeLists.txt index 51b5de1734..fda360f67b 100644 --- a/examples/quick/righttoleft/CMakeLists.txt +++ b/examples/quick/righttoleft/CMakeLists.txt @@ -1,20 +1,15 @@ -# Generated from righttoleft.pro. - cmake_minimum_required(VERSION 3.16) project(righttoleft 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/righttoleft") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") diff --git a/examples/quick/scenegraph/CMakeLists.txt b/examples/quick/scenegraph/CMakeLists.txt index afb1166a0c..663b7f9e33 100644 --- a/examples/quick/scenegraph/CMakeLists.txt +++ b/examples/quick/scenegraph/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from scenegraph.pro. - qt_internal_add_example(customgeometry) qt_internal_add_example(custommaterial) qt_internal_add_example(graph) diff --git a/examples/quick/scenegraph/customgeometry/CMakeLists.txt b/examples/quick/scenegraph/customgeometry/CMakeLists.txt index 4e3d13d08a..505f7921b6 100644 --- a/examples/quick/scenegraph/customgeometry/CMakeLists.txt +++ b/examples/quick/scenegraph/customgeometry/CMakeLists.txt @@ -1,33 +1,27 @@ -# Generated from customgeometry.pro. - cmake_minimum_required(VERSION 3.16) -project(customgeometry_declarative LANGUAGES CXX) # special case - -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(customgeometry_declarative LANGUAGES CXX) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/customgeometry") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick) -qt_add_executable(customgeometry_declarative # special case +qt_add_executable(customgeometry_declarative beziercurve.cpp beziercurve.h main.cpp ) + set_target_properties(customgeometry_declarative PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) -target_link_libraries(customgeometry_declarative PUBLIC # special case + +target_link_libraries(customgeometry_declarative PUBLIC Qt::Core Qt::Gui Qt::Quick @@ -41,7 +35,7 @@ qt_add_qml_module(customgeometry_declarative NO_RESOURCE_TARGET_PATH ) -install(TARGETS customgeometry_declarative # special case +install(TARGETS customgeometry_declarative RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/quick/scenegraph/custommaterial/CMakeLists.txt b/examples/quick/scenegraph/custommaterial/CMakeLists.txt index cbf6b0b5c7..a8ead8e39b 100644 --- a/examples/quick/scenegraph/custommaterial/CMakeLists.txt +++ b/examples/quick/scenegraph/custommaterial/CMakeLists.txt @@ -1,35 +1,27 @@ -# Generated from custommaterial.pro. - cmake_minimum_required(VERSION 3.16) -project(custommaterial_declarative LANGUAGES CXX) # special case - -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(custommaterial_declarative LANGUAGES CXX) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/custommaterial") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS ShaderTools) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick ShaderTools) -qt_add_executable(custommaterial_declarative # special case +qt_add_executable(custommaterial_declarative customitem.cpp customitem.h main.cpp ) + set_target_properties(custommaterial_declarative PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) -target_link_libraries(custommaterial_declarative PUBLIC # special case + +target_link_libraries(custommaterial_declarative PUBLIC Qt::Core Qt::Gui Qt::Qml @@ -56,7 +48,7 @@ qt6_add_shaders(custommaterial_declarative "shaders" "shaders/mandelbrot.frag" ) -install(TARGETS custommaterial_declarative # special case +install(TARGETS custommaterial_declarative RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/quick/scenegraph/d3d11underqml/CMakeLists.txt b/examples/quick/scenegraph/d3d11underqml/CMakeLists.txt index 74e077a7a5..757f14972a 100644 --- a/examples/quick/scenegraph/d3d11underqml/CMakeLists.txt +++ b/examples/quick/scenegraph/d3d11underqml/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from d3d11underqml.pro. - cmake_minimum_required(VERSION 3.16) project(d3d11underqml LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/d3d11underqml") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(d3d11underqml d3d11squircle.cpp d3d11squircle.h main.cpp ) + set_target_properties(d3d11underqml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(d3d11underqml PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/scenegraph/fboitem/CMakeLists.txt b/examples/quick/scenegraph/fboitem/CMakeLists.txt index 45c939b0d8..76f47b18c4 100644 --- a/examples/quick/scenegraph/fboitem/CMakeLists.txt +++ b/examples/quick/scenegraph/fboitem/CMakeLists.txt @@ -1,34 +1,27 @@ -# Generated from fboitem.pro. - cmake_minimum_required(VERSION 3.16) project(fboitem LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/fboitem") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(fboitem ../shared/logorenderer.cpp ../shared/logorenderer.h fboinsgrenderer.cpp fboinsgrenderer.h main.cpp ) + set_target_properties(fboitem PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_include_directories(fboitem PUBLIC ../shared ) diff --git a/examples/quick/scenegraph/graph/CMakeLists.txt b/examples/quick/scenegraph/graph/CMakeLists.txt index 93d0e6d61a..716e67300b 100644 --- a/examples/quick/scenegraph/graph/CMakeLists.txt +++ b/examples/quick/scenegraph/graph/CMakeLists.txt @@ -1,23 +1,15 @@ -# Generated from graph.pro. - cmake_minimum_required(VERSION 3.16) project(graph LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/graph") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick) qt_add_executable(graph graph.cpp graph.h @@ -26,6 +18,7 @@ qt_add_executable(graph main.cpp noisynode.cpp noisynode.h ) + set_target_properties(graph PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -33,6 +26,7 @@ set_target_properties(graph PROPERTIES # Prevent name clash with build subdirectory on case-insensitive file systems OUTPUT_NAME graphapp ) + target_link_libraries(graph PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/scenegraph/metaltextureimport/CMakeLists.txt b/examples/quick/scenegraph/metaltextureimport/CMakeLists.txt index eb3740f6ef..68451e292c 100644 --- a/examples/quick/scenegraph/metaltextureimport/CMakeLists.txt +++ b/examples/quick/scenegraph/metaltextureimport/CMakeLists.txt @@ -1,29 +1,21 @@ -# Generated from metaltextureimport.pro. - cmake_minimum_required(VERSION 3.16) project(metaltextureimport LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/metaltextureimport") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(metaltextureimport main.cpp metaltextureimport.h metaltextureimport.mm ) + set_target_properties(metaltextureimport PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -31,6 +23,7 @@ set_target_properties(metaltextureimport PROPERTIES # Prevent name clash with build subdirectory on case-insensitive file systems OUTPUT_NAME metaltextureimportapp ) + target_link_libraries(metaltextureimport PUBLIC "-framework Metal" Qt::Core diff --git a/examples/quick/scenegraph/metalunderqml/CMakeLists.txt b/examples/quick/scenegraph/metalunderqml/CMakeLists.txt index 752a5aa578..07c5e6ea2a 100644 --- a/examples/quick/scenegraph/metalunderqml/CMakeLists.txt +++ b/examples/quick/scenegraph/metalunderqml/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from metalunderqml.pro. - cmake_minimum_required(VERSION 3.16) project(metalunderqml LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/metalunderqml") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(metalunderqml main.cpp metalsquircle.h metalsquircle.mm ) + set_target_properties(metalunderqml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(metalunderqml PUBLIC "-framework Metal" Qt::Core diff --git a/examples/quick/scenegraph/openglunderqml/CMakeLists.txt b/examples/quick/scenegraph/openglunderqml/CMakeLists.txt index a99c5d84d1..d19204d925 100644 --- a/examples/quick/scenegraph/openglunderqml/CMakeLists.txt +++ b/examples/quick/scenegraph/openglunderqml/CMakeLists.txt @@ -1,29 +1,21 @@ -# Generated from openglunderqml.pro. - cmake_minimum_required(VERSION 3.16) project(openglunderqml LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/openglunderqml") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(openglunderqml main.cpp squircle.cpp squircle.h ) + set_target_properties(openglunderqml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -31,6 +23,7 @@ set_target_properties(openglunderqml PROPERTIES # Prevent name clash with build subdirectory on case-insensitive file systems OUTPUT_NAME openglunderqmlapp ) + target_link_libraries(openglunderqml PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/scenegraph/threadedanimation/CMakeLists.txt b/examples/quick/scenegraph/threadedanimation/CMakeLists.txt index 328b41bc9e..2279392964 100644 --- a/examples/quick/scenegraph/threadedanimation/CMakeLists.txt +++ b/examples/quick/scenegraph/threadedanimation/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from threadedanimation.pro. - cmake_minimum_required(VERSION 3.16) project(threadedanimation LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/threadedanimation") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(threadedanimation main.cpp spinner.cpp spinner.h ) + set_target_properties(threadedanimation PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(threadedanimation PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/scenegraph/twotextureproviders/CMakeLists.txt b/examples/quick/scenegraph/twotextureproviders/CMakeLists.txt index b33809f8a8..a89ad3260c 100644 --- a/examples/quick/scenegraph/twotextureproviders/CMakeLists.txt +++ b/examples/quick/scenegraph/twotextureproviders/CMakeLists.txt @@ -1,34 +1,26 @@ -# Generated from twotextureproviders.pro. - cmake_minimum_required(VERSION 3.16) project(twotextureproviders LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/twotextureproviders") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS ShaderTools) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick ShaderTools) qt_add_executable(twotextureproviders main.cpp xorblender.cpp xorblender.h ) + set_target_properties(twotextureproviders PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(twotextureproviders PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/scenegraph/vulkantextureimport/CMakeLists.txt b/examples/quick/scenegraph/vulkantextureimport/CMakeLists.txt index 5f58bd78c3..356e3f8672 100644 --- a/examples/quick/scenegraph/vulkantextureimport/CMakeLists.txt +++ b/examples/quick/scenegraph/vulkantextureimport/CMakeLists.txt @@ -1,29 +1,21 @@ -# Generated from vulkantextureimport.pro. - cmake_minimum_required(VERSION 3.16) project(vulkantextureimport LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/vulkantextureimport") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(vulkantextureimport main.cpp vulkantextureimport.cpp vulkantextureimport.h ) + set_target_properties(vulkantextureimport PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -31,6 +23,7 @@ set_target_properties(vulkantextureimport PROPERTIES # Prevent name clash with build subdirectory on case-insensitive file systems OUTPUT_NAME vulkantextureimportapp ) + target_link_libraries(vulkantextureimport PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/scenegraph/vulkanunderqml/CMakeLists.txt b/examples/quick/scenegraph/vulkanunderqml/CMakeLists.txt index 6921427d1b..8e4c3d346c 100644 --- a/examples/quick/scenegraph/vulkanunderqml/CMakeLists.txt +++ b/examples/quick/scenegraph/vulkanunderqml/CMakeLists.txt @@ -1,29 +1,21 @@ -# Generated from vulkanunderqml.pro. - cmake_minimum_required(VERSION 3.16) project(vulkanunderqml LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/vulkanunderqml") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(vulkanunderqml main.cpp vulkansquircle.cpp vulkansquircle.h ) + set_target_properties(vulkanunderqml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -31,6 +23,7 @@ set_target_properties(vulkanunderqml PROPERTIES # Prevent name clash with build subdirectory on case-insensitive file systems OUTPUT_NAME vulkanunderqmlapp ) + target_link_libraries(vulkanunderqml PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/shadereffects/CMakeLists.txt b/examples/quick/shadereffects/CMakeLists.txt index 172146c441..d4e612816b 100644 --- a/examples/quick/shadereffects/CMakeLists.txt +++ b/examples/quick/shadereffects/CMakeLists.txt @@ -1,33 +1,25 @@ -# Generated from shadereffects.pro. - cmake_minimum_required(VERSION 3.16) project(shadereffects LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/shadereffects") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS ShaderTools) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick ShaderTools) qt_add_executable(shadereffectsexample main.cpp ) + set_target_properties(shadereffectsexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(shadereffectsexample PUBLIC Qt::Core Qt::Gui @@ -35,7 +27,6 @@ target_link_libraries(shadereffectsexample PUBLIC Qt::Quick ) - qt_add_qml_module(shadereffectsexample URI shadereffects VERSION 1.0 diff --git a/examples/quick/shapes/CMakeLists.txt b/examples/quick/shapes/CMakeLists.txt index dce5effb63..8cdb3e15b3 100644 --- a/examples/quick/shapes/CMakeLists.txt +++ b/examples/quick/shapes/CMakeLists.txt @@ -1,40 +1,34 @@ -# Generated from shapes.pro. - cmake_minimum_required(VERSION 3.16) project(shapes LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/shapes") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") qt_add_executable(shapesexample main.cpp ) + set_target_properties(shapesexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(shapesexample PUBLIC Qt::Core Qt::Gui Qt::Qml Qt::Quick ) + add_dependencies(shapesexample shapes_shared) qt_add_qml_module(shapesexample @@ -71,4 +65,5 @@ install(TARGETS shapesexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(shapesexample) diff --git a/examples/quick/shared/CMakeLists.txt b/examples/quick/shared/CMakeLists.txt index ad3e89f6ff..545b1d1dca 100644 --- a/examples/quick/shared/CMakeLists.txt +++ b/examples/quick/shared/CMakeLists.txt @@ -50,6 +50,7 @@ install(TARGETS ${PROJECT_NAME}_shared RUNTIME DESTINATION "${INSTALL_SHAREDDIR}" LIBRARY DESTINATION "${INSTALL_SHAREDDIR}" ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir DESTINATION "${INSTALL_SHAREDDIR}" ) diff --git a/examples/quick/tableview/CMakeLists.txt b/examples/quick/tableview/CMakeLists.txt index d41fc2ff25..80ac8687d4 100644 --- a/examples/quick/tableview/CMakeLists.txt +++ b/examples/quick/tableview/CMakeLists.txt @@ -1,4 +1,2 @@ -# Generated from tableview.pro. - qt_internal_add_example(gameoflife) qt_internal_add_example(pixelator) diff --git a/examples/quick/tableview/gameoflife/CMakeLists.txt b/examples/quick/tableview/gameoflife/CMakeLists.txt index f47c27a7ce..34caa01c41 100644 --- a/examples/quick/tableview/gameoflife/CMakeLists.txt +++ b/examples/quick/tableview/gameoflife/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from gameoflife.pro. - cmake_minimum_required(VERSION 3.16) project(gameoflife LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tableview/gameoflife") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(gameoflife gameoflifemodel.cpp gameoflifemodel.h main.cpp ) + set_target_properties(gameoflife PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(gameoflife PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/tableview/pixelator/CMakeLists.txt b/examples/quick/tableview/pixelator/CMakeLists.txt index 4db28964df..55c489d56f 100644 --- a/examples/quick/tableview/pixelator/CMakeLists.txt +++ b/examples/quick/tableview/pixelator/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from pixelator.pro. - cmake_minimum_required(VERSION 3.16) project(qml_pixelator LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tableview/pixelator") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(qml_pixelator imagemodel.cpp imagemodel.h main.cpp ) + set_target_properties(qml_pixelator PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(qml_pixelator PUBLIC Qt::Core Qt::Gui diff --git a/examples/quick/text/CMakeLists.txt b/examples/quick/text/CMakeLists.txt index e2fa455b8b..63869e3c88 100644 --- a/examples/quick/text/CMakeLists.txt +++ b/examples/quick/text/CMakeLists.txt @@ -1,40 +1,34 @@ -# Generated from text.pro. - cmake_minimum_required(VERSION 3.16) project(text LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/text") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") qt_add_executable(textexample main.cpp ) + set_target_properties(textexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(textexample PUBLIC Qt::Core Qt::Gui Qt::Qml Qt::Quick ) + add_dependencies(textexample text_shared) qt_add_qml_module(textexample @@ -69,4 +63,5 @@ install(TARGETS textexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(textexample) diff --git a/examples/quick/threading/CMakeLists.txt b/examples/quick/threading/CMakeLists.txt index eb08dbe612..3176191364 100644 --- a/examples/quick/threading/CMakeLists.txt +++ b/examples/quick/threading/CMakeLists.txt @@ -1,40 +1,34 @@ -# Generated from threading.pro. - cmake_minimum_required(VERSION 3.16) project(threading LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/threading") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") qt_add_executable(threadingexample main.cpp ) + set_target_properties(threadingexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(threadingexample PUBLIC Qt::Core Qt::Gui Qt::Qml Qt::Quick ) + add_dependencies(threadingexample threading_shared) qt_add_qml_module(threadingexample @@ -54,4 +48,5 @@ install(TARGETS threadingexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(threadingexample) diff --git a/examples/quick/touchinteraction/CMakeLists.txt b/examples/quick/touchinteraction/CMakeLists.txt index f2856b7f6e..ba13336d12 100644 --- a/examples/quick/touchinteraction/CMakeLists.txt +++ b/examples/quick/touchinteraction/CMakeLists.txt @@ -1,40 +1,34 @@ -# Generated from touchinteraction.pro. - cmake_minimum_required(VERSION 3.16) project(touchinteraction LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/touchinteraction") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") qt_add_executable(touchinteractionexample main.cpp ) + set_target_properties(touchinteractionexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(touchinteractionexample PUBLIC Qt::Core Qt::Gui Qt::Qml Qt::Quick ) + add_dependencies(touchinteractionexample touchinteraction_shared) qt_add_qml_module(touchinteractionexample @@ -72,4 +66,5 @@ install(TARGETS touchinteractionexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(touchinteractionexample) diff --git a/examples/quick/tutorials/dynamicview/dynamicview1/CMakeLists.txt b/examples/quick/tutorials/dynamicview/dynamicview1/CMakeLists.txt index 2d38954fd9..44a1fc8bb5 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview1/CMakeLists.txt +++ b/examples/quick/tutorials/dynamicview/dynamicview1/CMakeLists.txt @@ -1,25 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(dynamicview1 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/dynamicview/dynamicview1") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(dynamicview1 main.cpp ) + set_target_properties(dynamicview1 PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/tutorials/dynamicview/dynamicview2/CMakeLists.txt b/examples/quick/tutorials/dynamicview/dynamicview2/CMakeLists.txt index cbb7ac5b3f..5925925fc0 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview2/CMakeLists.txt +++ b/examples/quick/tutorials/dynamicview/dynamicview2/CMakeLists.txt @@ -1,25 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(dynamicview2 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/dynamicview/dynamicview2") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(dynamicview2 main.cpp ) + set_target_properties(dynamicview2 PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/tutorials/dynamicview/dynamicview3/CMakeLists.txt b/examples/quick/tutorials/dynamicview/dynamicview3/CMakeLists.txt index 242585423b..8783fc6900 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview3/CMakeLists.txt +++ b/examples/quick/tutorials/dynamicview/dynamicview3/CMakeLists.txt @@ -1,25 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(dynamicview3 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/dynamicview/dynamicview3") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(dynamicview3 main.cpp ) + set_target_properties(dynamicview3 PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/tutorials/dynamicview/dynamicview4/CMakeLists.txt b/examples/quick/tutorials/dynamicview/dynamicview4/CMakeLists.txt index 2faae8b119..700f08d556 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview4/CMakeLists.txt +++ b/examples/quick/tutorials/dynamicview/dynamicview4/CMakeLists.txt @@ -1,25 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(dynamicview4 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/dynamicview/dynamicview4") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(dynamicview4 main.cpp ) + set_target_properties(dynamicview4 PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/tutorials/samegame/samegame1/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame1/CMakeLists.txt index ad791d77b5..d9448fff89 100644 --- a/examples/quick/tutorials/samegame/samegame1/CMakeLists.txt +++ b/examples/quick/tutorials/samegame/samegame1/CMakeLists.txt @@ -1,25 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(samegame1 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame1") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(samegame1 main.cpp ) + set_target_properties(samegame1 PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt index 5830622762..00d645904b 100644 --- a/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt +++ b/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt @@ -1,25 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(samegame2 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame2") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(samegame2 main.cpp ) + set_target_properties(samegame2 PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/tutorials/samegame/samegame3/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame3/CMakeLists.txt index 0c3aa34b9d..ca438bd0b5 100644 --- a/examples/quick/tutorials/samegame/samegame3/CMakeLists.txt +++ b/examples/quick/tutorials/samegame/samegame3/CMakeLists.txt @@ -1,25 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(samegame3 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame3") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(samegame3 main.cpp ) + set_target_properties(samegame3 PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/tutorials/samegame/samegame4/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame4/CMakeLists.txt index c89d191873..fb3ebe1885 100644 --- a/examples/quick/tutorials/samegame/samegame4/CMakeLists.txt +++ b/examples/quick/tutorials/samegame/samegame4/CMakeLists.txt @@ -1,25 +1,20 @@ cmake_minimum_required(VERSION 3.16) project(samegame4 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") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame4") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(samegame4 main.cpp ) + set_target_properties(samegame4 PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE diff --git a/examples/quick/views/CMakeLists.txt b/examples/quick/views/CMakeLists.txt index 59df78d940..56229edbf5 100644 --- a/examples/quick/views/CMakeLists.txt +++ b/examples/quick/views/CMakeLists.txt @@ -1,40 +1,34 @@ -# Generated from views.pro. - cmake_minimum_required(VERSION 3.16) project(views LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/views") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") qt_add_executable(viewsexample main.cpp ) + set_target_properties(viewsexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(viewsexample PRIVATE Qt::Core Qt::Gui Qt::Qml Qt::Quick ) + add_dependencies(viewsexample views_shared) qt_add_qml_module(viewsexample @@ -95,4 +89,5 @@ install(TARGETS viewsexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(viewsexample) diff --git a/examples/quick/window/CMakeLists.txt b/examples/quick/window/CMakeLists.txt index f8a9f45600..d041a82816 100644 --- a/examples/quick/window/CMakeLists.txt +++ b/examples/quick/window/CMakeLists.txt @@ -1,30 +1,22 @@ -# Generated from window.pro. - cmake_minimum_required(VERSION 3.16) project(window LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/window") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) add_subdirectory("../shared" "shared") qt_add_executable(windowexample main.cpp ) + set_target_properties(windowexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -46,6 +38,7 @@ target_link_libraries(windowexample PRIVATE Qt::Qml Qt::Quick ) + add_dependencies(windowexample window_shared) install(TARGETS windowexample @@ -53,4 +46,5 @@ install(TARGETS windowexample BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + bundle_shared(windowexample) -- cgit v1.2.3