diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-01-21 16:14:58 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-15 23:38:39 +0000 |
commit | 302b448870b0e2f9d6f643c7d67ead38863136d8 (patch) | |
tree | fbac99917b1dd534e5a4afd1aca1bec623000d74 | |
parent | f45597c50df4afe2f1d62c387dcfd4228064e200 (diff) |
Improve examples CMakeLists.txt
- 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
Change-Id: I42cb1788cd53082f71f6a67446dc94f502497dca
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
(cherry picked from commit 97c866c75f5d60a79d799279f315d744fbcc2174)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
27 files changed, 125 insertions, 418 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d06ca6f08..97a33599b 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from examples.pro. - qt_examples_build_begin(EXTERNAL_BUILD) if(QT_FEATURE_qt3d_extras) diff --git a/examples/qt3d/3d-text/CMakeLists.txt b/examples/qt3d/3d-text/CMakeLists.txt index 3f0a72db8..5ffa66b01 100644 --- a/examples/qt3d/3d-text/CMakeLists.txt +++ b/examples/qt3d/3d-text/CMakeLists.txt @@ -1,34 +1,25 @@ -# Generated from 3d-text.pro. - cmake_minimum_required(VERSION 3.16) project(3d-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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DExtras 3DInput 3DRender Core Gui) qt_add_executable(3d-text main.cpp ) + set_target_properties(3d-text PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(3d-text PUBLIC Qt::3DCore Qt::3DExtras diff --git a/examples/qt3d/CMakeLists.txt b/examples/qt3d/CMakeLists.txt index 841e8de19..20d47bc3e 100644 --- a/examples/qt3d/CMakeLists.txt +++ b/examples/qt3d/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from qt3d.pro. - qt_internal_add_example(3d-text) qt_internal_add_example(simple-cpp) if(TARGET Qt::Widgets) diff --git a/examples/qt3d/advancedcustommaterial/CMakeLists.txt b/examples/qt3d/advancedcustommaterial/CMakeLists.txt index 29b8aec7d..a4e7a392f 100644 --- a/examples/qt3d/advancedcustommaterial/CMakeLists.txt +++ b/examples/qt3d/advancedcustommaterial/CMakeLists.txt @@ -1,42 +1,33 @@ -# Generated from advancedcustommaterial.pro. - cmake_minimum_required(VERSION 3.16) project(advancedcustommaterial 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DRender) +find_package(Qt6 REQUIRED COMPONENTS 3DRender Core Gui Qml Quick) qt_add_executable(advancedcustommaterial main.cpp ) + set_target_properties(advancedcustommaterial PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(advancedcustommaterial PUBLIC + Qt::3DRender Qt::Core Qt::Gui Qt::Qml Qt::Quick - Qt::3DRender ) - # Resources: set(qml_resource_files "SceneRoot.qml" @@ -51,9 +42,8 @@ qt6_add_resources(advancedcustommaterial "qml" FILES ${qml_resource_files} ) -# special case begin + target_sources(advancedcustommaterial PRIVATE ${qml_resource_files}) # just to show qml files in creator -# special case end set(models_resource_files "models/waterPlane.obj" @@ -65,6 +55,7 @@ qt6_add_resources(advancedcustommaterial "models" FILES ${models_resource_files} ) + set(textures_resource_files "textures/WaterDiffuse.jpg" "textures/WaterNormal.jpg" @@ -80,6 +71,7 @@ qt6_add_resources(advancedcustommaterial "textures" FILES ${textures_resource_files} ) + set(shaders_resource_files "shaders/es2/water.frag" "shaders/es2/water.vert" diff --git a/examples/qt3d/anaglyph-rendering/CMakeLists.txt b/examples/qt3d/anaglyph-rendering/CMakeLists.txt index 64540830f..3ff2fb4d7 100644 --- a/examples/qt3d/anaglyph-rendering/CMakeLists.txt +++ b/examples/qt3d/anaglyph-rendering/CMakeLists.txt @@ -1,38 +1,25 @@ -# Generated from anaglyph-rendering.pro. - cmake_minimum_required(VERSION 3.16) project(anaglyph-rendering 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DExtras) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DExtras 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(anaglyph-rendering main.cpp ) + set_target_properties(anaglyph-rendering PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(anaglyph-rendering PUBLIC Qt::3DCore Qt::3DExtras @@ -46,7 +33,6 @@ target_link_libraries(anaglyph-rendering PUBLIC Qt::Quick ) - # Resources: set(resources_resource_files "StereoCamera.qml" @@ -60,6 +46,7 @@ qt6_add_resources(anaglyph-rendering "resources" FILES ${resources_resource_files} ) + set(cubemaps_resource_files "../exampleresources/assets/cubemaps/default/default_irradiance.dds" "../exampleresources/assets/cubemaps/default/default_specular.dds" @@ -79,6 +66,7 @@ qt6_add_resources(anaglyph-rendering "cubemaps" FILES ${cubemaps_resource_files} ) + set(obj_resource_files "../exampleresources/assets/obj/ball.obj" "../exampleresources/assets/obj/material-sphere.obj" diff --git a/examples/qt3d/audio-visualizer-qml/CMakeLists.txt b/examples/qt3d/audio-visualizer-qml/CMakeLists.txt index be4d569eb..eab5f00a8 100644 --- a/examples/qt3d/audio-visualizer-qml/CMakeLists.txt +++ b/examples/qt3d/audio-visualizer-qml/CMakeLists.txt @@ -1,36 +1,26 @@ -# Generated from audio-visualizer-qml.pro. - cmake_minimum_required(VERSION 3.16) project(audio-visualizer-qml 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Multimedia) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DQuick Core Gui Multimedia Qml Quick) qt_add_executable(audio-visualizer-qml main.cpp touchsettings.cpp touchsettings.h ) + set_target_properties(audio-visualizer-qml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(audio-visualizer-qml PUBLIC Qt::3DCore Qt::3DQuick @@ -41,7 +31,6 @@ target_link_libraries(audio-visualizer-qml PUBLIC Qt::Quick ) - # Resources: set(audio-visualizer-qml_resource_files "BarEntity.qml" diff --git a/examples/qt3d/basicshapes-cpp/CMakeLists.txt b/examples/qt3d/basicshapes-cpp/CMakeLists.txt index 5ddbaa0d4..8f16c8953 100644 --- a/examples/qt3d/basicshapes-cpp/CMakeLists.txt +++ b/examples/qt3d/basicshapes-cpp/CMakeLists.txt @@ -1,36 +1,26 @@ -# Generated from basicshapes-cpp.pro. - cmake_minimum_required(VERSION 3.16) project(basicshapes-cpp 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DExtras) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DExtras 3DInput 3DRender Core Gui Widgets) qt_add_executable(basicshapes-cpp main.cpp scenemodifier.cpp scenemodifier.h ) + set_target_properties(basicshapes-cpp PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(basicshapes-cpp PUBLIC Qt::3DCore Qt::3DExtras diff --git a/examples/qt3d/compute-particles/CMakeLists.txt b/examples/qt3d/compute-particles/CMakeLists.txt index d684041b4..687d59a49 100644 --- a/examples/qt3d/compute-particles/CMakeLists.txt +++ b/examples/qt3d/compute-particles/CMakeLists.txt @@ -1,36 +1,25 @@ -# Generated from compute-particles.pro. - cmake_minimum_required(VERSION 3.16) project(compute-particles 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DRender Core Gui Qml Quick) qt_add_executable(compute-particles main.cpp ) + set_target_properties(compute-particles PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(compute-particles PUBLIC Qt::3DCore Qt::3DInput @@ -42,7 +31,6 @@ target_link_libraries(compute-particles PUBLIC Qt::Quick ) - # Resources: set(compute-particles_resource_files "ComputeFrameGraph.qml" diff --git a/examples/qt3d/controls/CMakeLists.txt b/examples/qt3d/controls/CMakeLists.txt index f2b3a3110..aafcff92a 100644 --- a/examples/qt3d/controls/CMakeLists.txt +++ b/examples/qt3d/controls/CMakeLists.txt @@ -1,42 +1,33 @@ -# Generated from controls.pro. - cmake_minimum_required(VERSION 3.16) project(controls 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DRender) +find_package(Qt6 REQUIRED COMPONENTS 3DRender Core Gui Qml Quick) qt_add_executable(controls main.cpp ) + set_target_properties(controls PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(controls PUBLIC + Qt::3DRender Qt::Core Qt::Gui Qt::Qml Qt::Quick - Qt::3DRender ) - # Resources: set(controls_resource_files "Logo.qml" @@ -51,9 +42,7 @@ qt6_add_resources(controls "controls" ${controls_resource_files} ) -# special case begin target_sources(controls PRIVATE ${controls_resources_files}) # just to show qml files in creator -# special case end install(TARGETS controls RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/qt3d/controlsunderlay/CMakeLists.txt b/examples/qt3d/controlsunderlay/CMakeLists.txt index 34f32970e..85cb97547 100644 --- a/examples/qt3d/controlsunderlay/CMakeLists.txt +++ b/examples/qt3d/controlsunderlay/CMakeLists.txt @@ -1,42 +1,33 @@ -# Generated from controlsunderlay.pro. - cmake_minimum_required(VERSION 3.16) project(controlsunderlay 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DRender) +find_package(Qt6 REQUIRED COMPONENTS 3DRender Core Gui Qml Quick) qt_add_executable(controlsunderlay main.cpp ) + set_target_properties(controlsunderlay PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(controlsunderlay PUBLIC + Qt::3DRender Qt::Core Qt::Gui Qt::Qml Qt::Quick - Qt::3DRender ) - # Resources: set(controls_resource_files "Logo.qml" diff --git a/examples/qt3d/instanced-arrays-qml/CMakeLists.txt b/examples/qt3d/instanced-arrays-qml/CMakeLists.txt index 7fd89fbb6..ac122e191 100644 --- a/examples/qt3d/instanced-arrays-qml/CMakeLists.txt +++ b/examples/qt3d/instanced-arrays-qml/CMakeLists.txt @@ -1,38 +1,26 @@ -# Generated from instanced-arrays-qml.pro. - cmake_minimum_required(VERSION 3.16) project(instanced-arrays-qml 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(instanced-arrays-qml instancebuffer.cpp instancebuffer.h main.cpp ) + set_target_properties(instanced-arrays-qml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(instanced-arrays-qml PUBLIC Qt::3DCore Qt::3DInput @@ -45,7 +33,6 @@ target_link_libraries(instanced-arrays-qml PUBLIC Qt::Quick ) - # Resources: set(instanced-arrays-qml_resource_files "gl3/instanced.frag" diff --git a/examples/qt3d/lights/CMakeLists.txt b/examples/qt3d/lights/CMakeLists.txt index 9606bc369..946180faa 100644 --- a/examples/qt3d/lights/CMakeLists.txt +++ b/examples/qt3d/lights/CMakeLists.txt @@ -1,37 +1,25 @@ -# Generated from lights.pro. - cmake_minimum_required(VERSION 3.16) project(lights 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(lights main.cpp ) + set_target_properties(lights PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(lights PUBLIC Qt::3DCore Qt::3DInput @@ -44,7 +32,6 @@ target_link_libraries(lights PUBLIC Qt::Quick ) - # Resources: set(lights_resource_files "PlaneEntity.qml" @@ -58,6 +45,7 @@ qt6_add_resources(lights "lights" FILES ${lights_resource_files} ) + set(obj_resource_files "../exampleresources/assets/obj/ball.obj" "../exampleresources/assets/obj/material-sphere.obj" diff --git a/examples/qt3d/multiviewport/CMakeLists.txt b/examples/qt3d/multiviewport/CMakeLists.txt index b2a7f875a..54df41a5e 100644 --- a/examples/qt3d/multiviewport/CMakeLists.txt +++ b/examples/qt3d/multiviewport/CMakeLists.txt @@ -1,37 +1,25 @@ -# Generated from multiviewport.pro. - cmake_minimum_required(VERSION 3.16) project(multiviewport 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(multiviewport main.cpp ) + set_target_properties(multiviewport PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(multiviewport PUBLIC Qt::3DCore Qt::3DInput @@ -44,7 +32,6 @@ target_link_libraries(multiviewport PUBLIC Qt::Quick ) - # Resources: set(multiviewport_resource_files "Gear_scene.dae" @@ -59,6 +46,7 @@ qt6_add_resources(multiviewport "multiviewport" FILES ${multiviewport_resource_files} ) + set(test_scene_resource_files "../exampleresources/assets/test_scene.dae" ) diff --git a/examples/qt3d/pbr-materials/CMakeLists.txt b/examples/qt3d/pbr-materials/CMakeLists.txt index dfbd1c4fa..8f5ebb99d 100644 --- a/examples/qt3d/pbr-materials/CMakeLists.txt +++ b/examples/qt3d/pbr-materials/CMakeLists.txt @@ -1,37 +1,25 @@ -# Generated from pbr-materials.pro. - cmake_minimum_required(VERSION 3.16) project(pbr-materials 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(pbr-materials main.cpp ) + set_target_properties(pbr-materials PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(pbr-materials PUBLIC Qt::3DCore Qt::3DInput @@ -44,7 +32,6 @@ target_link_libraries(pbr-materials PUBLIC Qt::Quick ) - # Resources: set(materials_resource_files "BasicCamera.qml" @@ -59,6 +46,7 @@ qt6_add_resources(pbr-materials "materials" FILES ${materials_resource_files} ) + set(cubemaps_resource_files "../exampleresources/assets/cubemaps/default/default_irradiance.dds" "../exampleresources/assets/cubemaps/default/default_specular.dds" @@ -78,6 +66,7 @@ qt6_add_resources(pbr-materials "cubemaps" FILES ${cubemaps_resource_files} ) + set(obj_resource_files "../exampleresources/assets/obj/ball.obj" "../exampleresources/assets/obj/material-sphere.obj" diff --git a/examples/qt3d/phong-cubes/CMakeLists.txt b/examples/qt3d/phong-cubes/CMakeLists.txt index 512cb91a9..36a839d97 100644 --- a/examples/qt3d/phong-cubes/CMakeLists.txt +++ b/examples/qt3d/phong-cubes/CMakeLists.txt @@ -1,37 +1,25 @@ -# Generated from phong-cubes.pro. - cmake_minimum_required(VERSION 3.16) project(phong-cubes 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(phong-cubes main.cpp ) + set_target_properties(phong-cubes PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(phong-cubes PUBLIC Qt::3DCore Qt::3DInput @@ -44,7 +32,6 @@ target_link_libraries(phong-cubes PUBLIC Qt::Quick ) - # Resources: set(phong-cubes_resource_files "CubeEntity.qml" diff --git a/examples/qt3d/planets-qml/CMakeLists.txt b/examples/qt3d/planets-qml/CMakeLists.txt index 10920631d..037379818 100644 --- a/examples/qt3d/planets-qml/CMakeLists.txt +++ b/examples/qt3d/planets-qml/CMakeLists.txt @@ -1,42 +1,26 @@ -# Generated from planets-qml.pro. - cmake_minimum_required(VERSION 3.16) project(planets-qml 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Concurrent) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DQuickRender) -find_package(Qt6 COMPONENTS 3DQuickInput) -find_package(Qt6 COMPONENTS 3DQuickExtras) -find_package(Qt6 COMPONENTS Network) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DQuickInput 3DQuickRender 3DRender Concurrent Core Gui Network Qml Quick) qt_add_executable(planets-qml main.cpp networkcontroller.cpp networkcontroller.h ) + set_target_properties(planets-qml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(planets-qml PUBLIC Qt::3DCore Qt::3DInput @@ -53,7 +37,6 @@ target_link_libraries(planets-qml PUBLIC Qt::Quick ) - # Resources: set(planets-qml_resource_files "AppleTVInput.qml" @@ -114,6 +97,7 @@ qt6_add_resources(planets-qml "planets-qml" FILES ${planets-qml_resource_files} ) + set(planets-qml-images_resource_files "images/earth.png" "images/jupiter.png" diff --git a/examples/qt3d/qardboard/CMakeLists.txt b/examples/qt3d/qardboard/CMakeLists.txt index 91bb2d680..1a7c99062 100644 --- a/examples/qt3d/qardboard/CMakeLists.txt +++ b/examples/qt3d/qardboard/CMakeLists.txt @@ -1,40 +1,27 @@ -# Generated from qardboard.pro. - cmake_minimum_required(VERSION 3.16) project(qardboard 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DExtras) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DExtras 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(qardboard abstractdeviceorientation.cpp abstractdeviceorientation.h dummydeviceorientation.cpp dummydeviceorientation.h main.cpp ) + set_target_properties(qardboard PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(qardboard PUBLIC Qt::3DCore Qt::3DExtras @@ -48,7 +35,6 @@ target_link_libraries(qardboard PUBLIC Qt::Quick ) - # Resources: set(resources_resource_files "PlacedEntity.qml" @@ -65,6 +51,7 @@ qt6_add_resources(qardboard "resources" FILES ${resources_resource_files} ) + set(obj_resource_files "../exampleresources/assets/obj/ball.obj" "../exampleresources/assets/obj/material-sphere.obj" diff --git a/examples/qt3d/qgltf/CMakeLists.txt b/examples/qt3d/qgltf/CMakeLists.txt index a56434202..7feed3297 100644 --- a/examples/qt3d/qgltf/CMakeLists.txt +++ b/examples/qt3d/qgltf/CMakeLists.txt @@ -1,37 +1,25 @@ -# Generated from qgltf.pro. - cmake_minimum_required(VERSION 3.16) project(qgltf 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DQuickExtras) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(qgltf main.cpp ) + set_target_properties(qgltf PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(qgltf PUBLIC Qt::3DCore Qt::3DInput @@ -44,7 +32,6 @@ target_link_libraries(qgltf PUBLIC Qt::Quick ) - # Resources: set(qgltf_example_resource_files "Scene.qml" diff --git a/examples/qt3d/scene2d/CMakeLists.txt b/examples/qt3d/scene2d/CMakeLists.txt index 6b2350994..09eeb190c 100644 --- a/examples/qt3d/scene2d/CMakeLists.txt +++ b/examples/qt3d/scene2d/CMakeLists.txt @@ -1,35 +1,26 @@ -# Generated from scene2d.pro. - cmake_minimum_required(VERSION 3.16) project(scene2d 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DQuick 3DQuickExtras Core Gui Qml Quick) -qt_add_executable(scene2dsample # special case +qt_add_executable(scene2dsample main.cpp ) -set_target_properties(scene2dsample PROPERTIES # special case + +set_target_properties(scene2dsample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) -target_link_libraries(scene2dsample PUBLIC # special case + +target_link_libraries(scene2dsample PUBLIC Qt::3DQuick Qt::3DQuickExtras Qt::Core @@ -38,7 +29,6 @@ target_link_libraries(scene2dsample PUBLIC # special case Qt::Quick ) - # Resources: set(scene2d_resource_files "LogoControls.qml" @@ -46,14 +36,14 @@ set(scene2d_resource_files "main.qml" ) -qt6_add_resources(scene2dsample "scene2d" # special case +qt6_add_resources(scene2dsample "scene2d" PREFIX "/" FILES ${scene2d_resource_files} ) -install(TARGETS scene2dsample # special case +install(TARGETS scene2dsample RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/qt3d/scene3d/CMakeLists.txt b/examples/qt3d/scene3d/CMakeLists.txt index 27ede40f9..4efeb864d 100644 --- a/examples/qt3d/scene3d/CMakeLists.txt +++ b/examples/qt3d/scene3d/CMakeLists.txt @@ -1,34 +1,25 @@ -# Generated from scene3d.pro. - cmake_minimum_required(VERSION 3.16) project(scene3d 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DRender) +find_package(Qt6 REQUIRED COMPONENTS 3DInput 3DRender Core Gui Qml Quick) qt_add_executable(scene3d main.cpp ) + set_target_properties(scene3d PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(scene3d PUBLIC Qt::3DInput Qt::3DRender @@ -38,7 +29,6 @@ target_link_libraries(scene3d PUBLIC Qt::Quick ) - # Resources: set(scene3d_resource_files "AnimatedEntity.qml" @@ -52,9 +42,7 @@ qt6_add_resources(scene3d "scene3d" ${scene3d_resource_files} ) -# special case begin target_sources(scene3d PRIVATE ${scene3d_resource_files}) -# special case end install(TARGETS scene3d RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/qt3d/shadow-map-qml/CMakeLists.txt b/examples/qt3d/shadow-map-qml/CMakeLists.txt index d2c363c21..177bc261d 100644 --- a/examples/qt3d/shadow-map-qml/CMakeLists.txt +++ b/examples/qt3d/shadow-map-qml/CMakeLists.txt @@ -1,37 +1,25 @@ -# Generated from shadow-map-qml.pro. - cmake_minimum_required(VERSION 3.16) project(shadow-map-qml 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(shadow-map-qml main.cpp ) + set_target_properties(shadow-map-qml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(shadow-map-qml PUBLIC Qt::3DCore Qt::3DInput @@ -44,7 +32,6 @@ target_link_libraries(shadow-map-qml PUBLIC Qt::Quick ) - # Resources: set(shadow-map-qml_resource_files "AdsEffect.qml" @@ -75,6 +62,7 @@ qt6_add_resources(shadow-map-qml "shadow-map-qml" FILES ${shadow-map-qml_resource_files} ) + set(obj_resource_files "../exampleresources/assets/obj/ball.obj" "../exampleresources/assets/obj/material-sphere.obj" diff --git a/examples/qt3d/simple-cpp/CMakeLists.txt b/examples/qt3d/simple-cpp/CMakeLists.txt index c59739d03..6068ee161 100644 --- a/examples/qt3d/simple-cpp/CMakeLists.txt +++ b/examples/qt3d/simple-cpp/CMakeLists.txt @@ -1,35 +1,26 @@ -# Generated from simple-cpp.pro. - cmake_minimum_required(VERSION 3.16) project(simple-cpp 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DExtras 3DInput 3DRender Core Gui) qt_add_executable(simple-cpp main.cpp orbittransformcontroller.cpp orbittransformcontroller.h ) + set_target_properties(simple-cpp PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(simple-cpp PUBLIC Qt::3DCore Qt::3DExtras diff --git a/examples/qt3d/simple-qml/CMakeLists.txt b/examples/qt3d/simple-qml/CMakeLists.txt index 350055001..551d4ab91 100644 --- a/examples/qt3d/simple-qml/CMakeLists.txt +++ b/examples/qt3d/simple-qml/CMakeLists.txt @@ -1,38 +1,25 @@ -# Generated from simple-qml.pro. - cmake_minimum_required(VERSION 3.16) project(simple-qml 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DLogic) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DLogic 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(simple-qml main.cpp ) + set_target_properties(simple-qml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(simple-qml PUBLIC Qt::3DCore Qt::3DInput @@ -46,7 +33,6 @@ target_link_libraries(simple-qml PUBLIC Qt::Quick ) - # Resources: set(simple-qml_resource_files "main.qml" @@ -59,9 +45,7 @@ qt6_add_resources(simple-qml "simple-qml" ${simple-qml_resource_files} ) -# special case begin target_sources(simple-qml PRIVATE ${simple-qml_resource_files}) -# special case end install(TARGETS simple-qml RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/qt3d/simplecustommaterial/CMakeLists.txt b/examples/qt3d/simplecustommaterial/CMakeLists.txt index 7e36ec399..05eb07e31 100644 --- a/examples/qt3d/simplecustommaterial/CMakeLists.txt +++ b/examples/qt3d/simplecustommaterial/CMakeLists.txt @@ -1,42 +1,33 @@ -# Generated from simplecustommaterial.pro. - cmake_minimum_required(VERSION 3.16) project(simplecustommaterial 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DRender) +find_package(Qt6 REQUIRED COMPONENTS 3DRender Core Gui Qml Quick) qt_add_executable(simplecustommaterial main.cpp ) + set_target_properties(simplecustommaterial PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(simplecustommaterial PUBLIC + Qt::3DRender Qt::Core Qt::Gui Qt::Qml Qt::Quick - Qt::3DRender ) - # Resources: set(qml_resource_files "PlaneModel.qml" @@ -51,6 +42,7 @@ qt6_add_resources(simplecustommaterial "qml" FILES ${qml_resource_files} ) + set(shaders_resource_files "shaders/es2/simpleColor.frag" "shaders/es2/simpleColor.vert" diff --git a/examples/qt3d/wave/CMakeLists.txt b/examples/qt3d/wave/CMakeLists.txt index f45c0606e..d26dc7ab9 100644 --- a/examples/qt3d/wave/CMakeLists.txt +++ b/examples/qt3d/wave/CMakeLists.txt @@ -1,37 +1,25 @@ -# Generated from wave.pro. - cmake_minimum_required(VERSION 3.16) project(wave 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(wave main.cpp ) + set_target_properties(wave PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(wave PUBLIC Qt::3DCore Qt::3DInput @@ -44,7 +32,6 @@ target_link_libraries(wave PUBLIC Qt::Quick ) - # Resources: set(wave_resource_files "Background.qml" @@ -70,13 +57,10 @@ qt6_add_resources(wave "wave" ${wave_resource_files} ) -# special case begin target_sources(wave PRIVATE ${wave_resource_files}) -# special case end install(TARGETS wave RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) - diff --git a/examples/qt3d/widgets-scene3d/CMakeLists.txt b/examples/qt3d/widgets-scene3d/CMakeLists.txt index 1a41c6265..ed882c7c1 100644 --- a/examples/qt3d/widgets-scene3d/CMakeLists.txt +++ b/examples/qt3d/widgets-scene3d/CMakeLists.txt @@ -1,35 +1,25 @@ -# Generated from widgets-scene3d.pro. - cmake_minimum_required(VERSION 3.16) project(widgets-scene3d 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS QuickWidgets) -find_package(Qt6 COMPONENTS 3DInput) +find_package(Qt6 REQUIRED COMPONENTS 3DInput Core Gui Qml Quick QuickWidgets Widgets) qt_add_executable(widgets-scene3d main.cpp ) + set_target_properties(widgets-scene3d PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(widgets-scene3d PUBLIC Qt::3DInput Qt::Core @@ -40,14 +30,15 @@ target_link_libraries(widgets-scene3d PUBLIC Qt::Widgets ) - # Resources: set_source_files_properties("../scene3d/AnimatedEntity.qml" PROPERTIES QT_RESOURCE_ALIAS "AnimatedEntity.qml" ) + set_source_files_properties("../scene3d/main.qml" PROPERTIES QT_RESOURCE_ALIAS "main.qml" ) + set(widgets-scene3d_resource_files "../scene3d/AnimatedEntity.qml" "../scene3d/main.qml" diff --git a/examples/qt3d/wireframe/CMakeLists.txt b/examples/qt3d/wireframe/CMakeLists.txt index 28de840a2..07f0facf5 100644 --- a/examples/qt3d/wireframe/CMakeLists.txt +++ b/examples/qt3d/wireframe/CMakeLists.txt @@ -1,37 +1,25 @@ -# Generated from wireframe.pro. - cmake_minimum_required(VERSION 3.16) project(wireframe 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}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS 3DCore) -find_package(Qt6 COMPONENTS 3DRender) -find_package(Qt6 COMPONENTS 3DInput) -find_package(Qt6 COMPONENTS 3DQuick) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS 3DQuickExtras) +find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick) qt_add_executable(wireframe main.cpp ) + set_target_properties(wireframe PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(wireframe PUBLIC Qt::3DCore Qt::3DInput @@ -44,7 +32,6 @@ target_link_libraries(wireframe PUBLIC Qt::Quick ) - # Resources: set(wireframe_resource_files "BasicCamera.qml" @@ -63,6 +50,7 @@ qt6_add_resources(wireframe "wireframe" FILES ${wireframe_resource_files} ) + set(obj_resource_files "../exampleresources/assets/obj/ball.obj" "../exampleresources/assets/obj/material-sphere.obj" |