-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
71 lines (64 loc) · 1.57 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
set(TARGET_NAME "multi_level_instancing")
file(
GLOB_RECURSE SOURCES
*.h *.hpp *.c *.cpp)
file(
GLOB OPTIX_KERNELS
"optix_kernels.cu"
)
file(
GLOB GPU_KERNEL_DEPENDENCIES
"../../cuda_util.h"
"../../optix_util.h"
"../../optixu_on_cudau.h"
"../common/common.h"
"${TARGET_NAME}_shared.h"
)
nvcuda_compile_optix_ir(
SOURCES ${OPTIX_KERNELS}
DEPENDENCIES ${GPU_KERNEL_DEPENDENCIES}
TARGET_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${TARGET_NAME}/ptxes"
GENERATED_FILES OPTIX_PTXES
NVCC_OPTIONS
"-Xcompiler" "\"/wd 4819 /Zc:__cplusplus\""
"$<$<CONFIG:Debug>:-D_DEBUG=1>"
"$<$<CONFIG:Debug>:-G>"
"$<$<CONFIG:Debug>:-O0>"
"--gpu-architecture=compute_75"
"-std=${CPP_VER_CUDA}"
"-cudart" "shared"
"--use_fast_math"
"--relocatable-device-code=true"
"-I${OPTIX_INCLUDE_DIR}"
)
set_common_sources(FALSE)
# essentials
source_group(
"essentials" REGULAR_EXPRESSION
"${CMAKE_CURRENT_SOURCE_DIR}/[^/]*\.(h|hpp|c|cpp|cu)$")
add_executable(
"${TARGET_NAME}"
${UTIL_SOURCES}
${COMMON_SOURCES}
${OBJ_LOADER_SOURCES}
${SOURCES}
${OPTIX_KERNELS}
)
set_target_properties(
"${TARGET_NAME}" PROPERTIES
CXX_EXTENSIONS OFF
PROJECT_LABEL "${BASIC_SAMPLE_INDEX_STR}.${TARGET_NAME}"
FOLDER "samples")
target_compile_definitions(
"${TARGET_NAME}" PRIVATE
"CUDA_UTIL_DONT_USE_GL_INTEROP"
)
target_include_directories(
"${TARGET_NAME}" PRIVATE
"${OPTIX_INCLUDE_DIR}"
)
target_link_libraries(
"${TARGET_NAME}"
fakelib
CUDA::cuda_driver
)