-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
66 lines (48 loc) · 1.89 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
cmake_minimum_required(VERSION 3.25)
project("VulraySamples")
find_package(Vulkan REQUIRED COMPONENTS dxc)
if(WIN32) # on Windows, we need to copy the vulkan dlls to the output directory, but on Linux, we don't need to do that, because its in the system path
set(DXC_DLL $ENV{VULKAN_SDK}/Bin/dxcompiler.dll)
endif()
#add 3rd party libraries
add_subdirectory("Vulray")
add_subdirectory("Vendor/glfw")
add_subdirectory("Vendor/glm")
include_directories(
"Base/"
"Vulray/Include/"
"Vendor/glfw/"
"Vendor/glm/"
"Vendor/tinygltf/"
"${Vulkan_INCLUDE_DIRS}"
)
link_directories("Vulray" "Vendor/glfw/src")
link_libraries(Vulray glfw Vulkan::dxc_lib)
# helper function to copy shaders to the output directory for each sample
function(ConfigureTarget tgt)
set_property(TARGET ${tgt} PROPERTY CXX_STANDARD 20)
target_compile_definitions(${tgt} PRIVATE SAMPLE_NAME="${tgt}")
target_precompile_headers(${tgt} PRIVATE "${PROJECT_SOURCE_DIR}/Base/Common.h")
add_custom_command(
TARGET ${tgt} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Shaders $<TARGET_FILE_DIR:${tgt}>/Shaders
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Assets $<TARGET_FILE_DIR:${tgt}>/Assets
COMMENT "Copying shaders for ${tgt}")
if(WIN32)
add_custom_command(
TARGET ${tgt} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${DXC_DLL} $<TARGET_FILE_DIR:${tgt}>
COMMAND ${CMAKE_COMMAND} -E echo "Copying DXC dll")
endif()
endfunction()
# add samples
add_subdirectory("Samples/HelloTriangle")
add_subdirectory("Samples/DynamicBLAS")
add_subdirectory("Samples/DynamicTLAS")
add_subdirectory("Samples/MeshMaterials")
add_subdirectory("Samples/Shading")
add_subdirectory("Samples/BoxIntersections")
add_subdirectory("Samples/SBTData")
add_subdirectory("Samples/Compaction")
add_subdirectory("Samples/Callable")
add_subdirectory("Samples/GaussianBlurDenoising")