-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (57 loc) · 1.67 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
cmake_minimum_required(VERSION 3.23)
project(cannoli)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -fconcepts -pthread -DAABB_INT")
# === PROJECT SETUP ===
add_definitions( "-DFMT_HEADER_ONLY=1" )
include_directories(
${PROJECT_SOURCE_DIR}/include
${EIGEN3_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/fmt
)
add_library(${PROJECT_NAME} SHARED
# Source Files
src/ray_tracer.cpp
src/sphere.cpp
src/lambertian_brdf.cpp
src/metal_brdf.cpp
src/mesh.cpp
src/aabb.cpp
# Header Files
include/utils.h
include/canvas.h
include/camera.h
include/color.h
include/light_ray.h
include/point.h
include/ray_tracer.h
include/vec3f.h
include/object.h
include/scene.h
include/material.h
include/sphere.h
include/object_type.h
include/hit_record.h
include/lambertian_brdf.h
include/metal_brdf.h
include/mesh.h
include/obj_file_loader.h
include/aabb.h)
# === DEPENDENCIES ===
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/5376968f6948923e2411081fd9372e71a59d8e77.zip
)
FetchContent_MakeAvailable(googletest)
FIND_PACKAGE(Threads REQUIRED)
# ADD_SUBDIRECTORY(fmt)
# === TEST ===
add_executable(vec3_test ${PROJECT_SOURCE_DIR}/test/vec3f_test.cpp)
target_link_libraries(vec3_test gtest_main pthread)
add_test(NAME Vec3Test COMMAND vec3test)
# === RUN ===
add_executable(cannoli_main ${PROJECT_SOURCE_DIR}/src/cannoli_main.cpp)
target_link_libraries(
cannoli_main ${PROJECT_NAME}
)