forked from pritzza/Rodent-Raytracer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (36 loc) · 1.27 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
cmake_minimum_required(VERSION 3.22)
# set(CMAKE_C_COMPILER "/usr/bin/gcc")
# set(CMAKE_CXX_COMPILER "/usr/bin/g++")
# set(CMAKE_CUDA_COMPILER "/usr/local/cuda-12/bin/nvcc")
enable_language(CUDA)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(rodent_raytracer LANGUAGES CXX CUDA)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
# SFML fuckery
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x)
FetchContent_MakeAvailable(SFML)
add_executable(
rodent_raytracer
src/main.cpp
src/Primitive.cpp
src/Renderer.cpp
src/util/Math.cpp
src/util/Window.cpp
src/gpu.cu
src/Camera.cpp
src/Image.cpp
src/Rotor.cpp
)
set(SFML_LIBRARIES sfml-graphics sfml-window sfml-system)
target_include_directories(rodent_raytracer PUBLIC ${SFML_INCLUDE_DIRS})
target_link_libraries(rodent_raytracer PRIVATE ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
target_precompile_headers(rodent_raytracer PRIVATE src/PCH.h)
# CUDA stuff
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=sm_60")
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=sm_60")
set_target_properties(rodent_raytracer PROPERTIES CUDA_ARCHITECTURES "86")