### Install Application Files Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/view3d/CMakeLists.txt Installs the target executable, libraries, and bundles to their respective directories. Also installs a deployment script. ```cmake install(TARGETS view3d BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) qt_generate_deploy_qml_app_script( TARGET view3d OUTPUT_SCRIPT deploy_script MACOS_BUNDLE_POST_BUILD NO_UNSUPPORTED_PLATFORM_ERROR DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM ) install(SCRIPT ${deploy_script}) ``` -------------------------------- ### CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/particles3d/CMakeLists.txt Sets the minimum CMake version and project name for the particles3d example. ```cmake cmake_minimum_required(VERSION 3.16) project(particles3d LANGUAGES CXX) ``` -------------------------------- ### Project Setup and Executable Definition Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/custominstancing/CMakeLists.txt Configures the CMake version, project name, and defines the main executable for the custom instancing example. ```cmake cmake_minimum_required(VERSION 3.16) project(custominstancing LANGUAGES CXX) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Quick3D) qt_add_executable(custominstancing main.cpp ) set_target_properties(custominstancing PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) target_link_libraries(custominstancing PUBLIC Qt::Core Qt::Gui Qt::Quick Qt::Quick3D ) ``` -------------------------------- ### Install Executable and Libraries Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/dynamiccreation/CMakeLists.txt Installs the 'dynamiccreation' target. For Windows, it's installed as a bundle. For other platforms, it's installed to the runtime binary directory. ```cmake install(TARGETS dynamiccreation BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Qt Standard Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_advanced_touch/CMakeLists.txt Applies standard Qt project setup and policy for Qt 6.8. ```cmake qt_standard_project_setup(REQUIRES 6.8) qt6_policy(SET QTP0002 NEW) ``` -------------------------------- ### Installation Configuration Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/volumeraycaster/CMakeLists.txt Configures the installation of the target executable, runtime libraries, and bundles. ```cmake install(TARGETS volumeraycaster BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/reflectionprobes/CMakeLists.txt Initializes a CMake project for C++ and sets the minimum required CMake version. This is a standard starting point for any CMake-based project. ```cmake cmake_minimum_required(VERSION 3.16) project(reflectionprobes LANGUAGES CXX) ``` -------------------------------- ### Installation and Deployment Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/skinning/CMakeLists.txt Configures installation rules for the target executable and generates a script for deploying QML application resources. ```cmake install(TARGETS skinning BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) qt_generate_deploy_qml_app_script( TARGET skinning OUTPUT_SCRIPT deploy_script MACOS_BUNDLE_POST_BUILD NO_UNSUPPORTED_PLATFORM_ERROR DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM ) install(SCRIPT ${deploy_script}) ``` -------------------------------- ### Installing Application Files Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/helloqtquick3d/CMakeLists.txt Installs the application target and its associated files to the appropriate directories based on the build type and platform. Also installs a deployment script. ```cmake install(TARGETS helloqtquick3d BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) qt_generate_deploy_qml_app_script( TARGET helloqtquick3d OUTPUT_SCRIPT deploy_script MACOS_BUNDLE_POST_BUILD NO_UNSUPPORTED_PLATFORM_ERROR DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM ) install(SCRIPT ${deploy_script}) ``` -------------------------------- ### Standard Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/userpasses/CMakeLists.txt Applies standard Qt project setup configurations. This simplifies common project settings and requirements. ```cmake qt_standard_project_setup(REQUIRES 6.11) ``` -------------------------------- ### Installing Application Files Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/morphing/CMakeLists.txt Installs the built executable, libraries, and other necessary files to their designated locations. This prepares the application for deployment. ```cmake install(TARGETS morphing BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Installation Rules Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/quickitems/CMakeLists.txt Specifies how the built targets should be installed on the system. This includes executables, libraries, and bundles. ```cmake install(TARGETS quickitems BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Application Files Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/custommaterial/CMakeLists.txt Installs the application target and its associated files to the correct runtime destinations. ```cmake install(TARGETS custommaterial BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Installation Rules Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/picking/CMakeLists.txt Installs the 'picking' target to appropriate directories based on the build type (bundle, runtime, library). ```cmake install(TARGETS picking BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Installation Rules Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/ssgilightmap/CMakeLists.txt Defines installation rules for the 'ssgilightmap' target, specifying destinations for bundles, libraries, and runtime executables based on standard installation directories. ```cmake include(GNUInstallDirs) install(TARGETS ssgilightmap BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) ``` -------------------------------- ### Install Executable Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_simple/CMakeLists.txt Installs the 'xr_simple' target to the appropriate directories based on the platform. ```cmake install(TARGETS xr_simple BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/instancing/CMakeLists.txt Configures installation rules for the application executable, libraries, and bundles. ```cmake install(TARGETS instancing BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Application Installation Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/custommorphing/CMakeLists.txt Specifies installation rules for the custommorphing executable and its libraries. ```cmake install(TARGETS custommorphing BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Project Setup and Dependencies Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/ssgilightmap/CMakeLists.txt Initializes the project with a name and version, sets C++ standard requirements, and finds necessary Qt6 components (Quick, Quick3D). ```cmake include(FetchContent) project(ssgilightmap VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTORCC OFF) find_package(Qt6 REQUIRED COMPONENTS Quick Quick3D) ``` -------------------------------- ### CMakeLists.txt for Simple Fog Example Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/simplefog/CMakeLists.txt This is the main CMakeLists.txt file for the simple fog example. It sets up the project, finds Qt6 components, defines the executable, links libraries, and configures QML modules. ```cmake # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause cmake_minimum_required(VERSION 3.16) project(simplefog LANGUAGES CXX) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Quick3D) qt_add_executable(simplefog main.cpp ) set_target_properties(simplefog PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) target_link_libraries(simplefog PUBLIC Qt::Core Qt::Gui Qt::Quick Qt::Quick3D ) qt_add_qml_module(simplefog URI Example VERSION 1.0 QML_FILES main.qml NO_RESOURCE_TARGET_PATH ) install(TARGETS simplefog BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) qt_generate_deploy_qml_app_script( TARGET simplefog OUTPUT_SCRIPT deploy_script MACOS_BUNDLE_POST_BUILD NO_UNSUPPORTED_PLATFORM_ERROR DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM ) install(SCRIPT ${deploy_script}) ``` -------------------------------- ### Application Installation Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/reflectionprobes/CMakeLists.txt Configures the installation rules for the application's targets. This specifies where the executable, libraries, and bundles should be placed when the project is installed. ```cmake install(TARGETS reflectionprobes BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Application Installation Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/extensions/stenciloutline3d/CMakeLists.txt Installs the application targets (executable, libraries, bundles) to their respective destinations. This prepares the application for deployment. ```cmake install(TARGETS stenciloutline3d BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/submeshes/CMakeLists.txt Initializes CMake version, project name, and language. Finds required Qt6 components for Quick3D development. ```cmake cmake_minimum_required(VERSION 3.16) project(submeshes LANGUAGES CXX) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Quick3D) ``` -------------------------------- ### Build Qt Quick 3D from Source Source: https://github.com/qt/qtquick3d/blob/dev/README.md Commands to clone, initialize submodules, configure, build, and install Qt Quick 3D as a standalone project. ```bash git clone https://code.qt.io/qt/qtquick3d.git cd qtquick3d git submodule update --init --recursive cd ../your/build/directory/ mkdir qtquick3d cd qtquick3d ../qtbase/bin/qt-configure-module ../../path/to/qt/source/qtquick3d ninja # or make/nmake ninja install # or make/nmake install ``` -------------------------------- ### Install Qt Quick 3D Designer Source Files Source: https://github.com/qt/qtquick3d/blob/dev/src/quick3d/designer/source/CMakeLists.txt Copies shader files and QML templates to the installation destination. Ensure the destination path is correctly constructed using qt_path_join. ```cmake # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause qt_path_join(destination ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/QtQuick3D/designer/source") qt_copy_or_install( FILES custom_material_default_shader.frag effect_default_shader.frag effect_template.qml view3D_template.qml DESTINATION "${destination}" ) ``` -------------------------------- ### Installation and Deployment Script Generation Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/custominstancing/CMakeLists.txt Configures the installation of the target executable and generates a deployment script for QML applications. ```cmake install(TARGETS custominstancing BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) qt_generate_deploy_qml_app_script( TARGET custominstancing OUTPUT_SCRIPT deploy_script MACOS_BUNDLE_POST_BUILD NO_UNSUPPORTED_PLATFORM_ERROR DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM ) install(SCRIPT ${deploy_script}) ``` -------------------------------- ### QML Module and Resource Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/submeshes/CMakeLists.txt Configures a QML module with a specific URI and version, including QML files and mesh resources. Ensures resources are not installed to a target path. ```cmake qt_add_qml_module(submeshes URI Example VERSION 1.0 QML_FILES qml/DistortedCube.qml qml/main.qml RESOURCES meshes/distortedcube.mesh NO_RESOURCE_TARGET_PATH ) ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/offlineshaders/CMakeLists.txt Installs the application executable, libraries, and bundles to their respective destinations based on CMake installation directories. ```cmake install(TARGETS offlineshaders BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/intro/CMakeLists.txt Configures the installation of the application executable, libraries, and bundles to their respective destinations. ```cmake install(TARGETS intro BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Application Installation Rules Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/layers/CMakeLists.txt Specifies how the application executable, libraries, and bundles should be installed. This is crucial for deploying the application. ```cmake install(TARGETS layers BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Executable and Libraries Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_anchors/CMakeLists.txt Installs the target executable, runtime libraries, and bundles to their respective destinations. ```cmake install(TARGETS xr_anchors BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Installation Rules Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/lodhelper/CMakeLists.txt Defines how the built target should be installed. This includes specifying destinations for the executable, libraries, and bundles. ```cmake install(TARGETS lodhelper BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Target Files Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_freeformteleportation/CMakeLists.txt Installs the built target (executable, libraries, bundles) to their appropriate destinations based on the installation directory variables. ```cmake install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Run a QML Example with qmlscene Source: https://github.com/qt/qtquick3d/blob/dev/README.md Command to execute a QML file using the qmlscene utility. ```bash qmlscene main.qml ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/runtimeloader/CMakeLists.txt Defines installation rules for the 'runtimeloader' target. This specifies where the executable, libraries, and bundles should be placed when the project is installed. ```cmake install(TARGETS runtimeloader BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Executable Source: https://github.com/qt/qtquick3d/blob/dev/tests/manual/xr_simple_gesture/CMakeLists.txt Installs the target executable to the appropriate runtime directories. ```cmake install(TARGETS manual_test_xr_gesture BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Installing Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/userpasses/CMakeLists.txt Defines installation rules for the application's targets, including the executable, libraries, and bundles. This specifies where the built artifacts should be placed during installation. ```cmake install(TARGETS userpasses BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install JsonCpp using vcpkg Source: https://github.com/qt/qtquick3d/blob/dev/src/3rdparty/openxr/src/external/jsoncpp/README.md Instructions for installing JsonCpp using the vcpkg dependency manager. This involves cloning the vcpkg repository, bootstrapping, integrating, and then installing JsonCpp. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install jsoncpp ``` -------------------------------- ### Project Setup and Dependencies Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_advanced_touch/CMakeLists.txt Sets up the CMake build environment, defines project metadata, enables automatic meta-object compilation, and finds necessary Qt6 components including Quick3D and Quick3DXr. ```cmake cmake_minimum_required(VERSION 3.16) project(xr_advanced_touch VERSION 0.1 LANGUAGES CXX) set(CMAKE_AUTOMOC ON) find_package(Qt6 COMPONENTS Core Gui Quick Quick3D Quick3DXr) ``` -------------------------------- ### Installing Application Files Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/cascadedshadowmaps/CMakeLists.txt Defines installation rules for the application's targets, specifying where runtime files, libraries, and bundles should be placed on the target system. ```cmake install(TARGETS cascadedshadowmaps BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Basic CMake Configuration Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/lights/CMakeLists.txt Sets the minimum CMake version and project name for the Qt Quick 3D lights example. ```cmake cmake_minimum_required(VERSION 3.16) project(lights LANGUAGES CXX) ``` -------------------------------- ### Installing Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/sceneeffects/CMakeLists.txt Defines installation rules for the application executable, runtime libraries, and bundles on different platforms. ```cmake install(TARGETS sceneeffects BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/customeffect/CMakeLists.txt Sets the minimum CMake version, project name, and enables automatic build system integration for Qt. ```cmake cmake_minimum_required(VERSION 3.16) project(customeffect LANGUAGES CXX) set(CMAKE_AUTOMOC ON) ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/antialiasing/CMakeLists.txt Configures installation rules for the application executable, libraries, and bundles across different platforms. ```cmake install(TARGETS antialiasing BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/simpleruntimeloader/CMakeLists.txt Defines installation rules for the application's executable, libraries, and bundles across different platforms. ```cmake install(TARGETS simpleruntimeloader BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Create a Simple 3D Scene with Qt Quick 3D Source: https://github.com/qt/qtquick3d/blob/dev/README.md A QML example demonstrating how to set up a basic 3D scene with a camera, light, and two models (a red cube and a green sphere). ```qml import QtQuick import QtQuick3D Window { visible: true width: 640 height: 480 title: qsTr("Simple 3D Scene") // Create a view and 3D scene View3D { anchors.fill: parent camera: activeCamera PerspectiveCamera { id: activeCamera z: 400 } DirectionalLight { color: "white" } Model { x: -100 source: "#Cube" materials: PrincipledMaterial { baseColor: "red" } } Model { x: 100 source: "#Sphere" materials: PrincipledMaterial { baseColor: "green" } } } } ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/screenspacereflections/CMakeLists.txt Specifies installation rules for the application executable, libraries, and bundles. This ensures the application can be deployed correctly. ```cmake install(TARGETS screenspacereflections BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/skinning/CMakeLists.txt Initializes a CMake project for C++ with Qt 6 components. Ensures automatic meta-object compilation. ```cmake cmake_minimum_required(VERSION 3.16) project(skinning LANGUAGES CXX) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Quick3D) ``` -------------------------------- ### Install Executable and Libraries Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_interaction/CMakeLists.txt Installs the 'xr_interaction' target to specified destinations for bundles, runtime, and libraries. ```cmake install(TARGETS xr_interaction BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/sceneeffects/CMakeLists.txt Initializes the CMake build system, sets the minimum required version, and defines the project name and language. ```cmake cmake_minimum_required(VERSION 3.16) project(sceneeffects LANGUAGES CXX) ``` -------------------------------- ### Installing Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/proceduraltexture/CMakeLists.txt Defines installation rules for the application's executable, libraries, and bundles across different platforms. ```cmake install(TARGETS proceduraltexture BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Qt Project Setup and Executable Definition Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/volumeraycaster/CMakeLists.txt Configures standard Qt project settings and defines the main executable with its source files. ```cmake set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Quick3D) qt_standard_project_setup(REQUIRES 6.8) qt_add_executable(volumeraycaster main.cpp volumetexturedata.cpp volumetexturedata.h lineboxgeometry.cpp lineboxgeometry.h ) ``` -------------------------------- ### Installing Application Targets and Deploy Script Generation Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/customshaders/CMakeLists.txt Defines installation rules for the application executable, libraries, and bundles. It also generates a script for deploying QML application resources. ```cmake install(TARGETS customshaders BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) qt_generate_deploy_qml_app_script( TARGET customshaders OUTPUT_SCRIPT deploy_script MACOS_BUNDLE_POST_BUILD NO_UNSUPPORTED_PLATFORM_ERROR DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM ) install(SCRIPT ${deploy_script}) ``` -------------------------------- ### Install Qt Quick 3D Designer Images Source: https://github.com/qt/qtquick3d/blob/dev/src/quick3d/designer/images/CMakeLists.txt This snippet uses CMake commands to join paths and copy image files to the installation directory. It ensures that all specified image assets for the Qt Quick 3D designer are correctly placed. ```cmake # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause qt_path_join(destination ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/QtQuick3D/designer/images") qt_copy_or_install( FILES camera.png camera16.png camera@2x.png cone.png cone16.png cone@2x.png cube.png cube16.png cube@2x.png cubemaptexture.png cubemaptexture16.png cubemaptexture@2x.png custommaterial.png custommaterial16.png custommaterial@2x.png cylinder.png cylinder16.png cylinder@2x.png debugsettings.png debugsettings16.png debugsettings@2x.png dummy.png dummy16.png dummy@2x.png effect.png effect16.png effect@2x.png fileinstancing.png fileinstancing16.png fileinstancing@2x.png fog.png fog16.png fog@2x.png group.png group16.png group@2x.png instancelist.png instancelist16.png instancelist@2x.png instancelistentry.png instancelistentry16.png instancelistentry@2x.png joint.png joint16.png joint@2x.png lightdirectional.png lightdirectional16.png lightdirectional@2x.png lightmapper.png lightmapper16.png lightmapper@2x.png lightpoint.png lightpoint16.png lightpoint@2x.png lightspot.png lightspot16.png lightspot@2x.png loader3d.png loader3d16.png loader3d@2x.png material.png material16.png material@2x.png model16.png morphtarget.png morphtarget16.png morphtarget@2x.png plane.png plane16.png plane@2x.png reflectionProbe.png reflectionProbe16.png reflectionProbe@2x.png repeater3d.png repeater3d16.png repeater3d@2x.png resourceloader.png resourceloader16.png resourceloader@2x.png scene.png scene16.png scene@2x.png shadercommand.png shadercommand16.png shadercommand@2x.png shaderutil.png shaderutil16.png shaderutil@2x.png skeleton.png skeleton16.png skeleton@2x.png skin.png skin16.png skin@2x.png sphere.png sphere16.png sphere@2x.png texture.png texture16.png texture@2x.png view3D.png view3D16.png view3D@2x.png DESTINATION "${destination}" ) ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/bakedlightmap/CMakeLists.txt Installs the application executable and libraries to their designated locations. Bundles the executable on macOS. ```cmake install(TARGETS bakedlightmap BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/volumeraycaster/CMakeLists.txt Sets up the minimum CMake version, project name, and language. It also finds the OpenMP package if available. ```cmake cmake_minimum_required(VERSION 3.16) project(volumeraycaster LANGUAGES CXX) find_package(OpenMP) ``` -------------------------------- ### Install Application Target Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/principledmaterial/CMakeLists.txt Installs the 'principledmaterial' executable and its associated files to the appropriate directories based on the build type and platform. ```cmake install(TARGETS principledmaterial BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/hellocube/CMakeLists.txt Installs the application executable, libraries, and bundles to their respective destinations. This is part of the build and deployment process. ```cmake install(TARGETS hellocube BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/quickball/CMakeLists.txt Installs the application executable, libraries, and bundles to their respective destinations based on the build type and platform. ```cmake install(TARGETS quickball BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install Application Target Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/customeffect/CMakeLists.txt Installs the 'customeffect' target to appropriate locations on the system based on the build type and platform. ```cmake install(TARGETS customeffect BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Install JsonCpp using Meson Build System Source: https://github.com/qt/qtquick3d/blob/dev/src/3rdparty/openxr/src/external/jsoncpp/README.md Instructions for obtaining a JsonCpp wrap file for the Meson Build System. This can be done by downloading from Meson WrapDB or using the 'meson wrap install jsoncpp' command. ```bash meson wrap install jsoncpp ``` -------------------------------- ### Installation Configuration Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/submeshes/CMakeLists.txt Specifies installation rules for the 'submeshes' target, defining destinations for executables, libraries, and bundles based on platform. ```cmake install(TARGETS submeshes BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Generate and Install Deployment Script Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_interaction/CMakeLists.txt Generates a script for deploying QML application resources and installs it. Includes options for macOS bundle post-build deployment. ```cmake qt_generate_deploy_qml_app_script( TARGET xr_interaction OUTPUT_SCRIPT deploy_script MACOS_BUNDLE_POST_BUILD NO_UNSUPPORTED_PLATFORM_ERROR DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM ) install(SCRIPT ${deploy_script}) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/custommaterial/CMakeLists.txt Sets the minimum CMake version, project name, and enables automatic meta-object compilation. ```cmake cmake_minimum_required(VERSION 3.16) project(custommaterial LANGUAGES CXX) set(CMAKE_AUTOMOC ON) ``` -------------------------------- ### Installation Rules Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/customgeometry/CMakeLists.txt Specifies installation rules for the customgeometry target, defining where the executable, libraries, and bundles should be placed. ```cmake install(TARGETS customgeometry BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/quickball/CMakeLists.txt Sets the minimum CMake version and project name. Ensures automatic meta-object compilation. ```cmake cmake_minimum_required(VERSION 3.16) project(quickball LANGUAGES CXX) set(CMAKE_AUTOMOC ON) ``` -------------------------------- ### CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/morphing/CMakeLists.txt Configures the minimum CMake version, project name, and enables automatic meta-object compilation. This is a standard setup for Qt projects using CMake. ```cmake cmake_minimum_required(VERSION 3.16) project(morphing LANGUAGES CXX) set(CMAKE_AUTOMOC ON) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/antialiasing/CMakeLists.txt Sets the minimum required CMake version and defines the project name and language. ```cmake cmake_minimum_required(VERSION 3.16) project(antialiasing LANGUAGES CXX) ``` -------------------------------- ### Qt Project Setup and Resource Compilation Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/ssgilightmap/CMakeLists.txt Sets up standard Qt project configurations and compiles QRC resources, including external model assets and local assets, ensuring they are not compressed. ```cmake qt_standard_project_setup(REQUIRES 6.10) set(SOURCES main.cpp) qt_add_big_resources(SOURCES ${model_assets_SOURCE_DIR}/model_assets.qrc OPTIONS -no-compress) qt_add_big_resources(SOURCES assets.qrc OPTIONS -no-compress) list(APPEND SOURCES ${model_assets_SOURCE_DIR}/model_assets.qrc) list(APPEND SOURCES assets.qrc) set_property(SOURCE ${model_assets_SOURCE_DIR}/model_assets.qrc PROPERTY SKIP_AUTORCC ON) set_property(SOURCE assets.qrc PROPERTY SKIP_AUTORCC ON) ``` -------------------------------- ### Install Deployment Script Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/hellocube/CMakeLists.txt Installs the generated QML deployment script. This script is used to ensure QML components are correctly deployed with the application. ```cmake install(SCRIPT ${deploy_script}) ``` -------------------------------- ### Install Application Target Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/orderindependenttransparency/CMakeLists.txt Installs the 'oit3d' target to appropriate directories based on the build type (bundle, runtime, library). ```cmake install(TARGETS oit3d BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Define Installation Path for Particles3D Designer Images Source: https://github.com/qt/qtquick3d/blob/dev/src/quick3dparticles/designer/images/CMakeLists.txt Uses the qt_path_join function to construct the destination path for the Particles3D designer images within the Qt installation directory. ```cmake qt_path_join(destination ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/QtQuick3D/Particles3D/designer/images") ``` -------------------------------- ### Install Application Targets Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/lights/CMakeLists.txt Installs the 'lights' target to appropriate locations based on the platform, including bundle destination for macOS, runtime destination for executables, and library destination. ```cmake install(TARGETS lights BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Define Installation Path for Asset Images Source: https://github.com/qt/qtquick3d/blob/dev/src/assetutils/designer/images/CMakeLists.txt Uses CMake's qt_path_join to construct the installation directory for QtQuick3D asset images, ensuring they are placed in the correct QML directory for designer use. ```cmake qt_path_join(destination ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/QtQuick3D/AssetUtils/designer/images") ``` -------------------------------- ### CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/custommorphing/CMakeLists.txt Basic CMake configuration for a Qt 6 project, including C++ language support and project name. ```cmake cmake_minimum_required(VERSION 3.16) project(custommorphing LANGUAGES CXX) ``` -------------------------------- ### Installing OpenXR Headers Source: https://github.com/qt/qtquick3d/blob/dev/src/3rdparty/openxr/include/openxr/CMakeLists.txt Installs the generated and platform-defined OpenXR header files to the designated include directory during the CMake installation step. ```cmake install( FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openxr COMPONENT Headers ) ``` -------------------------------- ### Generate QML Module Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_interaction/CMakeLists.txt Creates a QML module named 'Example' with version 1.0, specifying the QML files to be included and disabling resource target path. ```cmake qt_add_qml_module(xr_interaction URI Example VERSION 1.0 QML_FILES main.qml Scene.qml GadgetBox.qml NO_RESOURCE_TARGET_PATH ) ``` -------------------------------- ### CMake Minimum Version and Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/tests/auto/quick3d_particles/qquick3dparticlelineparticle/CMakeLists.txt Sets the minimum required CMake version and defines the project name and language. This is a standard setup for CMake projects. ```cmake cmake_minimum_required(VERSION 3.16) project(tst_qquick3dparticlelineparticle LANGUAGES CXX) ``` -------------------------------- ### CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/customgeometry/CMakeLists.txt Configures the minimum CMake version, project name, and enables automatic meta-object compilation. It finds and requires necessary Qt6 components. ```cmake cmake_minimum_required(VERSION 3.16) project(customgeometry LANGUAGES CXX) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Quick3D) qt_standard_project_setup(REQUIRES 6.8) ``` -------------------------------- ### Basic CMake Configuration for Qt Quick 3D Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/customshaders/CMakeLists.txt Sets up the minimum CMake version, project name, and enables automatic meta-object compilation. This is a standard starting point for Qt projects. ```cmake cmake_minimum_required(VERSION 3.16) project(customshaders LANGUAGES CXX) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Quick3D) ``` -------------------------------- ### Define QML Module Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/particles3d/CMakeLists.txt Defines a QML module named 'Example' with version 1.0, specifying the QML files and resources to be included. ```cmake qt_add_qml_module(particles3d URI Example VERSION 1.0 QML_FILES AlignedParticles.qml AnimatedSprite.qml AttractorShapes.qml ColorfulParticles.qml CustomCheckBox.qml CustomLabel.qml CustomSlider.qml CustomSelectionBox.qml DynamicBursts.qml EmitAndBurst.qml EmitterCustomShapes.qml EmitterShapes.qml FadingInOut.qml Fire.qml HeartTrail.qml Lights.qml LoggingView.qml ModelBlendParticles.qml OceanSpider.qml QtLogoAnimation.qml SettingsView.qml Snowing.qml Sorting.qml Speedometer.qml StartupView.qml SystemPlayPause.qml TrailEmitterBurst.qml ModelShape.qml main.qml LineParticles.qml AppSettings.qml SceneShape.qml RESOURCES images/arrow_icon.png images/bear_black.png images/colorTable.png images/color_table2.png images/color_table3.png images/color_table4.png images/color_table5.png images/dot.png images/dust.png images/explosion_01_strip13.png images/icon_interval.png images/icon_logging.png images/icon_pause.png images/icon_play.png images/icon_settings.png images/leather_n.png images/qt_logo.png images/qt_logo2.png images/qt_logo2_n.png images/smoke.png images/smoke_sprite.png images/snowflake.png images/speedometer_labels.png images/sphere.png images/sprite_09.png images/star.png images/star2.png images/star3.png meshes/meter_background.mesh meshes/meter_edge.mesh meshes/oldqtlogo.mesh meshes/suzanne.mesh data/qt_logo_in_4096.cbor data/qt_logo_out_4096.cbor data/heart_4096.cbor NO_RESOURCE_TARGET_PATH ) ``` -------------------------------- ### CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/cascadedshadowmaps/CMakeLists.txt Initializes the CMake build system for the project, specifying the minimum required version and project name. It also enables automatic meta-object compilation. ```cmake cmake_minimum_required(VERSION 3.16) project(cascadedshadowmaps LANGUAGES CXX) set(CMAKE_AUTOMOC ON) ``` -------------------------------- ### Define QML Module Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/dynamiccreation/CMakeLists.txt Creates a QML module named 'Example' with version 1.0, specifying QML files and resources. NO_RESOURCE_TARGET_PATH prevents resource files from being placed in a target-specific path. ```cmake qt_add_qml_module(dynamiccreation URI Example VERSION 1.0 QML_FILES WeirdShape.qml main.qml RESOURCES weirdShape.mesh NO_RESOURCE_TARGET_PATH ) ``` -------------------------------- ### Install Qt Quick 3D Designer Helper Images Source: https://github.com/qt/qtquick3d/blob/dev/src/helpers/designer/images/CMakeLists.txt Uses `qt_path_join` to define the destination path and `qt_copy_or_install` to copy image assets. Ensure the QT_INSTALL_DIR and INSTALL_QMLDIR variables are correctly set in your CMake configuration. ```cmake # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause qt_path_join(destination ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/QtQuick3D/Helpers/designer/images") qt_copy_or_install( FILES axishelper.png axishelper16.png axishelper@2x.png debugview.png debugview16.png debugview@2x.png dummy.png dummy16.png dummy@2x.png extendedsceneenvironment.png extendedsceneenvironment16.png extendedsceneenvironment@2x.png gridgeometry.png gridgeometry16.png gridgeometry@2x.png heightfieldgeometry.png heightfieldgeometry16.png heightfieldgeometry@2x.png infinitegrid.png infinitegrid16.png infinitegrid@2x.png instancemodel.png instancemodel16.png instancemodel@2x.png lookatnode.png lookatnode16.png lookatnode@2x.png instancerepeater.png instancerepeater16.png instancerepeater@2x.png wasdcontroller.png wasdcontroller16.png wasdcontroller@2x.png orbitcameracontroller.png orbitcameracontroller16.png orbitcameracontroller@2x.png proceduralskytexturedata.png proceduralskytexturedata16.png proceduralskytexturedata@2x.png lodmanager.png lodmanager16.png lodmanager@2x.png DESTINATION "${destination}" ) ``` -------------------------------- ### Join Paths and Copy Files with CMake Source: https://github.com/qt/qtquick3d/blob/dev/src/effects/designer/images/CMakeLists.txt Defines the destination path for image assets and copies them to the installation directory. Ensure the QT_INSTALL_DIR and INSTALL_QMLDIR variables are correctly set. ```cmake # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause qt_path_join(destination ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/QtQuick3D/Effects/designer/images") qt_copy_or_install( FILES effect.png effect16.png effect@2x.png DESTINATION "${destination}" ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/bakedlightmap/CMakeLists.txt Sets the minimum CMake version and project name for a C++ project. Ensures automatic meta-object compilation is enabled. ```cmake cmake_minimum_required(VERSION 3.16) project(bakedlightmap LANGUAGES CXX) set(CMAKE_AUTOMOC ON) ``` -------------------------------- ### Finalize Executable and Installation Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/xr_advanced_touch/CMakeLists.txt Finalizes the executable build and defines installation rules for the target executable. ```cmake qt_finalize_executable(${CMAKE_PROJECT_NAME}) install(TARGETS ${CMAKE_PROJECT_NAME} BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) ``` -------------------------------- ### CMake Minimum Version and Project Setup Source: https://github.com/qt/qtquick3d/blob/dev/tests/manual/desktop_vr_hybrid_app/CMakeLists.txt Sets the minimum required CMake version and defines the project name and language. This is typically at the beginning of a CMakeLists.txt file. ```cmake cmake_minimum_required(VERSION 3.16) project(desktop_vr_hybrid_app LANGUAGES CXX) ``` -------------------------------- ### Basic CMake Setup for Standalone Tests Source: https://github.com/qt/qtquick3d/blob/dev/tests/auto/quick3d/qquick3drepeater/CMakeLists.txt Sets up the minimum CMake version and project name for standalone tests. This block is skipped if building within the main Qt project. ```cmake if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) cmake_minimum_required(VERSION 3.16) project(tst_qquick3drepeater LANGUAGES CXX) find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) endif() ``` -------------------------------- ### Copy Particle System Templates to Destination Source: https://github.com/qt/qtquick3d/blob/dev/src/quick3dparticles/designer/source/CMakeLists.txt Installs various particle system QML template files to the specified destination directory using CMake's qt_copy_or_install. ```cmake qt_copy_or_install( FILES particlesystem_animatedsprite_template.qml particlesystem_attractor_template.qml particlesystem_burst_template.qml particlesystem_modelblend_template.qml particlesystem_modelshape_template.qml particlesystem_particletrail_template.qml particlesystem_sprite_template.qml particlesystem_template.qml particlesystem_wander_template.qml DESTINATION "${destination}" ) ``` -------------------------------- ### Install Target Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/particles3d/CMakeLists.txt Installs the 'particles3d' target to the appropriate locations for executables, libraries, and bundles based on the platform. ```cmake install(TARGETS particles3d BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Define QML Module and Resources Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/orderindependenttransparency/CMakeLists.txt Creates a QML module named 'Example' with version 1.0. It lists all QML files, resource files (images, meshes), and specifies that resources should not be placed in a target path. ```cmake qt_add_qml_module(oit3d URI Example VERSION 1.0 QML_FILES CustomCheckBox.qml CustomLabel.qml CustomSlider.qml CustomSelectionBox.qml SettingsView.qml StartupView.qml main.qml AppSettings.qml BlendValueTest.qml Particles.qml CustomInfoView.qml Instancing.qml FireStone.qml FireStick.qml FireParticles.qml RandomEmitter.qml RESOURCES images/arrow_icon.png images/icon_settings.png images/qt_logo.png images/qt_logo2.png images/qt_logo2_n.png images/tilepattern.png images/pillar_normal.png images/firestone.png images/stick_charred.png images/stick_heat3.png images/color_table3.png images/flame.png meshes/asteroid.mesh meshes/block.mesh meshes/stick3.mesh NO_RESOURCE_TARGET_PATH ) ``` -------------------------------- ### Configure Linux/glx Backend Source: https://github.com/qt/qtquick3d/blob/dev/src/xr/quick3dxr/openxr/CMakeLists.txt Configures the Quick3DXr target for Linux using XCB and GLX. Requires XCB and XCB GLX plugin features. ```cmake qt_internal_extend_target(Quick3DXr CONDITION QT_FEATURE_xcb AND QT_FEATURE_xcb_glx_plugin DEFINES XR_USE_PLATFORM_XLIB XR_USE_PLATFORM_XCB ) ``` -------------------------------- ### Conditional Build Setup for Standalone Tests Source: https://github.com/qt/qtquick3d/blob/dev/tests/auto/quick3d/qquick3drenderpass/CMakeLists.txt Configures the CMake minimum version and project for the test suite only when not building standalone tests or the main Qt library. Ensures proper project setup for the test environment. ```cmake if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) cmake_minimum_required(VERSION 3.16) project(tst_qquick3drenderpass LANGUAGES CXX) find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) endif() ``` -------------------------------- ### Define Installation Path for Particle Designer QML Files Source: https://github.com/qt/qtquick3d/blob/dev/src/quick3dparticles/designer/CMakeLists.txt Uses the qt_path_join function to construct the destination path for QML files within the Qt installation directory. This ensures that particle designer components are placed in the correct location for runtime access. ```cmake qt_path_join(destination ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/QtQuick3D/Particles3D/designer") ``` -------------------------------- ### Project Definition Source: https://github.com/qt/qtquick3d/blob/dev/config.tests/quick3d_assimp/CMakeLists.txt Defines the project name and the languages it will use. This is a standard CMake project setup. ```cmake project(config_test_quick3d_assimp LANGUAGES C CXX) ``` -------------------------------- ### Get Tool Target Name Source: https://github.com/qt/qtquick3d/blob/dev/tools/balsamui/CMakeLists.txt Retrieves the target name for the balsamui tool. This is a utility function for CMake. ```cmake qt_get_tool_target_name(target_name balsamui) ``` -------------------------------- ### Configure Linux/wayland Backend Source: https://github.com/qt/qtquick3d/blob/dev/src/xr/quick3dxr/openxr/CMakeLists.txt Configures the Quick3DXr target for Linux using Wayland. Requires the Wayland feature. ```cmake qt_internal_extend_target(Quick3DXr CONDITION LINUX AND QT_FEATURE_wayland DEFINES XR_USE_PLATFORM_WAYLAND ) ``` -------------------------------- ### Qt Module Discovery Source: https://github.com/qt/qtquick3d/blob/dev/examples/quick3d/extensions/stenciloutline3d/CMakeLists.txt Finds the necessary Qt6 modules required for the project. Ensure Qt6 is installed and discoverable by CMake. ```cmake find_package(Qt6 REQUIRED COMPONENTS Core GuiPrivate Quick Quick3DPrivate) ``` -------------------------------- ### Add Manual Test Configuration Source: https://github.com/qt/qtquick3d/blob/dev/tests/manual/unlit_lit_test/CMakeLists.txt Configures a manual test for Qt Quick 3D, specifying GUI requirements, source files, and linked libraries. ```cmake qt_internal_add_manual_test(manual_test_unlit_lit GUI SOURCES rhitest.cpp LIBRARIES Qt::Gui Qt::Quick Qt::Quick3DPrivate ) ```