-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (30 loc) · 1.17 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
cmake_minimum_required(VERSION 3.5)
project(RayTracing VERSION 0.0.1)
add_subdirectory(third_party/stb_image_write)
add_subdirectory(third_party/nlohmann)
add_subdirectory(third_party/cxxopts)
#configure_file(include/Version.hpp.in Version.hpp)
ADD_CUSTOM_COMMAND(
OUTPUT version.h
_version.h
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_SOURCE_DIR}/version.cmake)
include_directories(include "${PROJECT_BINARY_DIR}")
add_executable(RayTracing src/main.cpp
src/vec3.cpp
src/Sphere.cpp
src/HittableList.cpp
src/Camera.cpp
src/utils.cpp
src/Color.cpp
src/Material.cpp
src/Renderer.cpp
src/Arguments.cpp
${CMAKE_BINARY_DIR}/version.h)
if(UNIX)
target_link_libraries(RayTracing pthread)
endif(UNIX)
target_link_libraries(RayTracing StbImageWrite Nlohmann cxxopts)
set_target_properties(RayTracing PROPERTIES DEBUG_POSTFIX d)
install(TARGETS RayTracing
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)