-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
77 lines (63 loc) · 1.51 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
72
73
74
75
76
77
cmake_minimum_required(VERSION 3.12)
project(rayz)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(libs)
add_compile_definitions(GLEW_STATIC)
add_compile_definitions(MT)
find_package(TBB REQUIRED)
find_package(OpenGL REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
pkg_search_module(GLEW REQUIRED glew)
include_directories(
include
${GLFW_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIRS}
)
add_executable(
${PROJECT_NAME}
main.cpp
src/objects/plane.cpp
src/objects/sphere.cpp
src/objects/triangle.cpp
src/textures/checkerTexture.cpp
src/textures/imageTexture.cpp
src/textures/solidColorTexture.cpp
src/textures/noise.cpp
src/materials/lambertian.cpp
src/materials/diffuseLight.cpp
src/materials/metal.cpp
src/materials/dielectric.cpp
src/boundingBox.cpp
src/camera.cpp
src/hittable.cpp
src/material.cpp
src/renderer.cpp
src/scene.cpp
)
target_link_libraries(
${PROJECT_NAME}
${GLFW_LIBRARIES}
${GLEW_LIBRARIES}
${OPENGL_LIBRARIES}
jug
TBB::tbb
)
add_custom_target(
copy_textures
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_LIST_DIR}/textures
${CMAKE_CURRENT_BINARY_DIR}/textures
)
add_custom_target(
copy_jug_assests
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_LIST_DIR}/libs/jug/assests
${CMAKE_CURRENT_BINARY_DIR}/assests
)
add_dependencies(
${PROJECT_NAME}
copy_textures
copy_jug_assests
)