-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
29 lines (23 loc) · 1013 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
cmake_minimum_required(VERSION 3.3)
project(SunPathTracer)
# host compiler settings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# CUDA settings
find_package(CUDA QUIET REQUIRED)
list(APPEND CUDA_NVCC_FLAGS --maxrregcount=32 --compiler-options -fno-strict-aliasing -use_fast_math -Xptxas -v)
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
include_directories(${CUDA_TOOLKIT_INCLUDE})
# OpenGL and GLFW
find_package(OpenGL REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
find_package(GLM REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLFW_INCLUDE_DIRS})
include_directories(${GLM_INCLUDE_DIRS})
set(CUDA_SOURCES pathtracer.cu)
set(SOURCE_FILES main.cpp Scene.cpp ObjMesh.cpp BVH.cpp utils.cpp)
cuda_compile(CUDA_OBJS ${CUDA_SOURCES})
add_executable(SunPathTracer ${SOURCE_FILES} ${CUDA_OBJS})
target_link_libraries(SunPathTracer ${CUDA_LIBRARIES} ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES})