Debian Codegraph @

tests/manual/anaglyph-rendering/CMakeLists.txt

raw
1 # Copyright (C) 2022 The Qt Company Ltd.
2 # SPDX-License-Identifier: BSD-3-Clause
3
4 cmake_minimum_required(VERSION 3.16)
5 project(anaglyph-rendering LANGUAGES CXX)
6
7 set(CMAKE_AUTOMOC ON)
8
9 if(NOT DEFINED INSTALL_EXAMPLESDIR)
10 set(INSTALL_EXAMPLESDIR "examples")
11 endif()
12
13 set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}")
14
15 find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DExtras 3DInput 3DQuick 3DQuickExtras 3DRender Core Gui Qml Quick)
16
17 qt_add_executable(anaglyph-rendering
18 main.cpp
19 )
20
21 set_target_properties(anaglyph-rendering PROPERTIES
22 WIN32_EXECUTABLE TRUE
23 MACOSX_BUNDLE TRUE
24 )
25
26 target_link_libraries(anaglyph-rendering PUBLIC
27 Qt::3DCore
28 Qt::3DExtras
29 Qt::3DInput
30 Qt::3DQuick
31 Qt::3DQuickExtras
32 Qt::3DRender
33 Qt::Core
34 Qt::Gui
35 Qt::Qml
36 Qt::Quick
37 )
38
39 # Resources:
40 set(resources_resource_files
41 "StereoCamera.qml"
42 "StereoFrameGraph.qml"
43 "main.qml"
44 )
45
46 qt6_add_resources(anaglyph-rendering "resources"
47 PREFIX
48 "/"
49 FILES
50 ${resources_resource_files}
51 )
52
53 set(cubemaps_resource_files
54 "../exampleresources/assets/cubemaps/default/default_irradiance.dds"
55 "../exampleresources/assets/cubemaps/default/default_specular.dds"
56 "../exampleresources/assets/cubemaps/miramar/miramar_negx.webp"
57 "../exampleresources/assets/cubemaps/miramar/miramar_negy.webp"
58 "../exampleresources/assets/cubemaps/miramar/miramar_negz.webp"
59 "../exampleresources/assets/cubemaps/miramar/miramar_posx.webp"
60 "../exampleresources/assets/cubemaps/miramar/miramar_posy.webp"
61 "../exampleresources/assets/cubemaps/miramar/miramar_posz.webp"
62 )
63
64 qt6_add_resources(anaglyph-rendering "cubemaps"
65 PREFIX
66 "/"
67 BASE
68 "../exampleresources"
69 FILES
70 ${cubemaps_resource_files}
71 )
72
73 set(obj_resource_files
74 "../exampleresources/assets/obj/ball.obj"
75 "../exampleresources/assets/obj/material-sphere.obj"
76 "../exampleresources/assets/obj/plane-10x10.obj"
77 "../exampleresources/assets/obj/toyplane.obj"
78 "../exampleresources/assets/obj/trefoil.obj"
79 )
80
81 qt6_add_resources(anaglyph-rendering "obj"
82 PREFIX
83 "/"
84 BASE
85 "../exampleresources"
86 FILES
87 ${obj_resource_files}
88 )
89
90 install(TARGETS anaglyph-rendering
91 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
92 BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
93 LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
94 )