-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
71 lines (60 loc) · 2.47 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
################################################################################
# Rev project
# Sample project that creates a simple scene graph
################################################################################
cmake_minimum_required (VERSION 3.10)
project(gideon)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 20)
# Visual studio specifics
if(MSVC)
add_definitions(-DNOMINMAX)
endif(MSVC)
# Clasify sources according to folder structure. Useful for having nice visual studio filters.
# This macro is derived from http://www.cmake.org/pipermail/cmake/2013-November/056336.html
macro(GroupSources curdir dirLabel)
file(GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${curdir}
${PROJECT_SOURCE_DIR}/${curdir}/*)
foreach(child ${children})
if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${curdir}/${child})
GroupSources(${curdir}/${child} ${dirLabel}/${child})
else()
string(REPLACE "/" "\\" groupname ${dirLabel})
source_group(${groupname} FILES
${PROJECT_SOURCE_DIR}/${curdir}/${child})
endif()
endforeach()
endmacro()
################################################################################
# Actual pathtracer code
################################################################################
# Collect all sources
file(GLOB_RECURSE PATHTRACER_SOURCE_FILES "pathtracer/*.cpp" "pathtracer/*.h" "pathtracer/*.inl" "include/*.h" "include/*.hpp")
GroupSources(pathtracer pathtracer)
GroupSources(include include)
add_executable(pathtracer ${PATHTRACER_SOURCE_FILES})
target_include_directories (pathtracer PUBLIC "include")
target_include_directories (pathtracer PUBLIC "pathtracer")
################################################################################
# tests code
################################################################################
enable_testing()
include_directories ("include")
include_directories ("pathtracer")
add_executable(algebraTest
test/unit/algebraTest.cpp
pathtracer/math/matrix.cpp)
set_target_properties(algebraTest PROPERTIES FOLDER test)
add_test(algebra_unit_test algebraTest)
add_executable(collisionTest
test/unit/collisionTest.cpp
pathtracer/collision/CWBVH.cpp)
set_target_properties(collisionTest PROPERTIES FOLDER test)
add_test(collision_unit_test collisionTest)
add_executable(tlasTest
test/unit/tlasTest.cpp
pathtracer/math/matrix.cpp
pathtracer/collision/CWBVH.cpp
pathtracer/collision/TLAS.cpp)
set_target_properties(tlasTest PROPERTIES FOLDER test)
add_test(tlas_unit_test tlasTest)