-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·37 lines (33 loc) · 1.32 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
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
project(ComputerGraphics CXX)
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/framework")
# Create framework library and include CMake scripts (compiler warnings, sanitizers and static analyzers).
add_subdirectory("framework")
else()
# During development the framework lives in parent folder.
add_subdirectory("../../../framework/" "${CMAKE_BINARY_DIR}/framework/")
endif()
get_optional_packages(TARGET OptionalPackages PACKAGES "catch2" "assimp" "stb")
add_executable(FinalProject2
"src/main.cpp"
"src/ray_tracing.cpp"
"src/scene.cpp"
"src/mesh.cpp"
"src/draw.cpp"
"src/screen.cpp"
"src/bounding_volume_hierarchy.cpp"
"src/image.cpp"
"src/stb_image.cpp")
# Link to all dependencies / make their header files available.
target_link_libraries(FinalProject2 PRIVATE CGFramework OptionalPackages)
target_compile_features(FinalProject2 PRIVATE cxx_std_17) # C++17
enable_sanitizers(FinalProject2)
set_project_warnings(FinalProject2)
find_package(OpenMP)
if (OpenMP_FOUND)
target_link_libraries(FinalProject2 PRIVATE OpenMP::OpenMP_CXX)
target_compile_definitions(FinalProject2 PRIVATE "-DUSE_OPENMP=1")
endif()
target_compile_definitions(FinalProject2 PRIVATE
"-DDATA_DIR=\"${CMAKE_CURRENT_LIST_DIR}/data/\""
"-DOUTPUT_DIR=\"${CMAKE_CURRENT_LIST_DIR}/\"")