-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathCMakeLists.txt
49 lines (40 loc) · 1.29 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
cmake_minimum_required (VERSION 3.5)
project(TinySoftRenderer)
# C++ 11 is required
set(CMAKE_CXX_STANDARD 11)
include_directories(include)
include_directories(${PROJECT_SOURCE_DIR}/external/include)
IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
link_directories(${PROJECT_SOURCE_DIR}/external/libs)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(SDL2 REQUIRED)
# check if boost was found
if(SDL2_FOUND)
message ("SDL2 found")
else()
message (FATAL_ERROR "Cannot find SDL2")
endif()
ENDIF()
file(GLOB_RECURSE SRCS ./src/*.cpp)
file(GLOB_RECURSE HEADERS include/*.h)
source_group("Header Files" FILES ${HEADERS})
add_library(${PROJECT_NAME} ${SRCS} ${HEADERS})
add_library(TinySoftRenderer::renderer ALIAS ${PROJECT_NAME})
# link the target with the SDL2
target_link_libraries( ${PROJECT_NAME}
PUBLIC
SDL2
SDL2main
tbb
tbb12
assimp
)
# Add sub directories
add_subdirectory(examples/example1_point_lighting)
add_subdirectory(examples/example2_spot_lighting)
add_subdirectory(examples/example3_directional_lighting)
add_subdirectory(examples/example4_alpha_blending)
add_subdirectory(examples/example5_alpha_to_coverage)
add_subdirectory(examples/example6_diablo3_pose)
add_subdirectory(examples/example7_normal_mapping)
add_subdirectory(examples/example8_complicated_scene)