-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
72 lines (62 loc) · 3.19 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
cmake_minimum_required(VERSION 3.5)
project (BasicRT3 VERSION 1.0.0 LANGUAGES CXX )
#=== CREATING COMPILING DATABASE ===#
# Currently CMake (since 2.8.5) supports generation of compilation databases
# for Unix Makefile builds (Ninja builds in the works) with the option
# CMAKE_EXPORT_COMPILE_COMMANDS.
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
#=== FINDING PACKAGES ===#
# # Locate TinyXml2 package (library)
# # find_package(TinyXml2 REQUIRED)
# # include_directories(${TinyXML2_INCLUDE_DIRS})
# TinyXML2 is not a module package, therefore cannot be found with find_package() command.
# Set those manually, for now.
set( TinyXML2_INCLUDE_DIRS "tinyxml2" )
set( TinyXML2_LIB_DIRS "tinyxml2" )
set( TinyXML2_LIBRARIES "tinyxml2" )
# Set "manually" paths that need to be considered while compiling/linking
include_directories( cameras
integrators
core
ext
${TinyXML2_INCLUDE_DIRS} )
link_directories( ${TinyXML2_LIB_DIRS} )
#=== SETTING VARIABLES ===#
# Compiling flags
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -fopenmp -O3 -fno-rtti" )
set( RT3_SOURCE_DIR "src" )
#=== main target ===
add_executable(basic_rt3 ${RT3_SOURCE_DIR}/core/api.cpp
${RT3_SOURCE_DIR}/core/Background/background.cpp
${RT3_SOURCE_DIR}/core/Background/BackgroundColor.cpp
${RT3_SOURCE_DIR}/core/Background/BackgroundTexture.cpp
${RT3_SOURCE_DIR}/core/bounds3f.cpp
${RT3_SOURCE_DIR}/core/bvh.cpp
${RT3_SOURCE_DIR}/core/material.cpp
${RT3_SOURCE_DIR}/core/camera.cpp
${RT3_SOURCE_DIR}/core/error.cpp
${RT3_SOURCE_DIR}/core/film.cpp
${RT3_SOURCE_DIR}/core/image_io.cpp
${RT3_SOURCE_DIR}/core/parser.cpp
${RT3_SOURCE_DIR}/core/camera.cpp
${RT3_SOURCE_DIR}/core/Integrator/SamplerIntegrator.cpp
${RT3_SOURCE_DIR}/core/Integrator/BlinnPhongIntegrator.cpp
${RT3_SOURCE_DIR}/core/Integrator/DepthIntegrator.cpp
${RT3_SOURCE_DIR}/core/Integrator/FlatIntegrator.cpp
${RT3_SOURCE_DIR}/core/Integrator/NormalMapIntegrator.cpp
${RT3_SOURCE_DIR}/core/Shape/Sphere.cpp
${RT3_SOURCE_DIR}/core/Shape/Triangle.cpp
${RT3_SOURCE_DIR}/core/Light/light.cpp
${RT3_SOURCE_DIR}/core/Light/AmbientLight.cpp
${RT3_SOURCE_DIR}/core/Light/DirectionalLight.cpp
${RT3_SOURCE_DIR}/core/Light/PointLight.cpp
${RT3_SOURCE_DIR}/core/Light/SpotLight.cpp
${RT3_SOURCE_DIR}/core/tinyxml2.cpp
${RT3_SOURCE_DIR}/core/Transform.cpp
${RT3_SOURCE_DIR}/core/ray.cpp
${RT3_SOURCE_DIR}/ext/lodepng.cpp
${RT3_SOURCE_DIR}/main/rt3.cpp
)
#target_link_libraries(basic_rt3 PRIVATE ${TinyXML2_LIBRARIES})
#define C++17 as the standard.
set_property(TARGET basic_rt3 PROPERTY CXX_STANDARD 17)