-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
142 lines (111 loc) · 5.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
cmake_minimum_required (VERSION 3.0)
project( "LavaCake-Examples" )
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(LavaCake)
###############################################################
# Sample projects #
###############################################################
file( COPY "${CMAKE_CURRENT_LIST_DIR}/Samples/Data" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" )
#Console renderer
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/ConsoleRenderer/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME ${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/ConsoleRenderer/${FILENAME}.spv spv1.3)
endforeach()
add_executable( ConsoleRenderer "Samples/Source Files/ConsoleRenderer/main.cpp")
AutoSPIRV(ConsoleRenderer)
target_link_libraries( ConsoleRenderer LavaCake )
set_property( TARGET ConsoleRenderer PROPERTY FOLDER "Samples" )
#Fourier Transform
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/FourierTransform/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME ${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/FourierTransform/${FILENAME}.spv spv1.3)
endforeach()
add_executable( FourierTransform "Samples/Source Files/FourierTransform/main.cpp")
AutoSPIRV(FourierTransform)
target_link_libraries( FourierTransform LavaCake )
set_property( TARGET FourierTransform PROPERTY FOLDER "Samples" )
#Hello World
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/HelloWorld/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME ${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/HelloWorld/${FILENAME}.spv spv1.3)
endforeach()
add_executable( HelloWorld "Samples/Source Files/HelloWorld/main.cpp")
AutoSPIRV(HelloWorld)
target_link_libraries( HelloWorld LavaCake )
set_property( TARGET HelloWorld PROPERTY FOLDER "Samples" )
#Array Sum
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/ArraySum/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME ${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/ArraySum/${FILENAME}.spv spv1.3)
endforeach()
add_executable( ArraySum "Samples/Source Files/ArraySum/main.cpp")
AutoSPIRV(ArraySum)
target_link_libraries( ArraySum LavaCake )
set_property( TARGET ArraySum PROPERTY FOLDER "Samples" )
#ImGui
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/ImGui/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME ${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/ImGui/${FILENAME}.spv spv1.3)
endforeach()
add_executable( ImGui "Samples/Source Files/ImGui/main.cpp")
AutoSPIRV(ImGui)
target_link_libraries( ImGui LavaCake )
set_property( TARGET ImGui PROPERTY FOLDER "Samples" )
#Instancing
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/Instancing/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME ${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/Instancing/${FILENAME}.spv spv1.3)
endforeach()
add_executable( Instancing "Samples/Source Files/Instancing/main.cpp")
AutoSPIRV(Instancing)
target_link_libraries( Instancing LavaCake )
set_property( TARGET Instancing PROPERTY FOLDER "Samples" )
#JumpFlooding
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/JumpFlooding/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME ${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/JumpFlooding/${FILENAME}.spv spv1.3)
endforeach()
add_executable( JumpFlooding "Samples/Source Files/JumpFlooding/main.cpp")
AutoSPIRV(JumpFlooding)
target_link_libraries( JumpFlooding LavaCake )
set_property( TARGET JumpFlooding PROPERTY FOLDER "Samples" )
option(BUILD_RAYTRACING_EXAMPLE "Build the raytracing example" off)
#RT Hello World
if(BUILD_RAYTRACING_EXAMPLE)
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/RaytracingHelloWorld/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME RaytracingHelloWorld/${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/RaytracingHelloWorld/${FILENAME}.spv spv1.4)
endforeach()
add_executable( RaytracingHelloWorld "Samples/Source Files/RaytracingHelloWorld/main.cpp")
AutoSPIRV(RaytracingHelloWorld)
target_link_libraries( RaytracingHelloWorld LavaCake )
set_property( TARGET RaytracingHelloWorld PROPERTY FOLDER "Samples" )
#RT Cornell box
clearShader()
file( GLOB SHADER_SOURCE_FILES "Samples/Data/Shaders/CornellBox/*")
FOREACH( shader ${SHADER_SOURCE_FILES} )
string(REGEX MATCH "[A-Za-z0-9_\\-]*\\.[A-Za-z0-9]*" FILENAME CornellBox/${shader})
addShader(${shader} ${CMAKE_CURRENT_BINARY_DIR}/Data/Shaders/CornellBox/${FILENAME}.spv spv1.4)
endforeach()
add_executable( CornellBox "Samples/Source Files/CornellBox/main.cpp")
AutoSPIRV(CornellBox)
target_link_libraries( CornellBox LavaCake )
set_property( TARGET CornellBox PROPERTY FOLDER "Samples" )
endif()