-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
49 lines (35 loc) · 843 Bytes
/
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
project(RayTracing LANGUAGES CXX CUDA)
cmake_minimum_required(VERSION 3.18)
set(CMAKE_BUILD_TYPE Release)
enable_language(CUDA)
include(CheckLanguage)
check_language(CUDA)
find_package(OpenMP REQUIRED)
add_subdirectory(glm)
add_subdirectory(toml11)
add_executable(main main.cpp)
add_executable(main_cuda main.cu)
target_compile_options(main
PRIVATE
"-march=native")
set_target_properties(main_cuda PROPERTIES CUDA_ARCHITECTURES 61)
target_compile_options(main_cuda
PRIVATE
"-DUSE_GPU=1"
"--expt-relaxed-constexpr"
"--resource-usage"
"--restrict"
"-Xptxas=\"-v\"")
target_compile_features(main
PUBLIC
cxx_std_17)
target_compile_features(main_cuda
PUBLIC
cuda_std_17)
target_link_libraries(main
OpenMP::OpenMP_CXX
glm::glm
toml11::toml11)
target_link_libraries(main_cuda
glm::glm
toml11::toml11)