-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (50 loc) · 2.42 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
cmake_minimum_required ( VERSION 3.10 )
project ( computer-graphics-labs )
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo" CACHE STRING "" FORCE)
if(UNIX)
set(OpenGL_GL_PREFERENCE "GLVND")
endif(UNIX)
# For windows we use our bundled binaries.
if(WIN32)
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/external/embree2")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/external/sdl2")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/external/glew")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/external/glm")
endif(WIN32)
macro(config_build_output)
if(MSVC)
set(DLL_DIRECTORIES "${CMAKE_SOURCE_DIR}/external/bin")
set(MSVC_RUNTIME_DIR "${CMAKE_SOURCE_DIR}/bin")
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${MSVC_RUNTIME_DIR}" )
# Copy DLLs
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${DLL_DIRECTORIES}" "${MSVC_RUNTIME_DIR}"
)
set(vs_user_file "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.vcxproj.user")
string(REGEX REPLACE "v([0-9][0-9])([0-9])" "\\1.\\2" "VS_TOOLSET_VERSION" "${CMAKE_VS_PLATFORM_TOOLSET}")
configure_file("${CMAKE_SOURCE_DIR}/VSUserTemplate.user" "${vs_user_file}" @ONLY)
endif(MSVC)
endmacro(config_build_output)
add_definitions(-DGLM_ENABLE_EXPERIMENTAL)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set ( CMAKE_EXPORT_COMPILE_COMMANDS ON )
set ( CMAKE_CXX_STANDARD 11 )
if( NOT CMAKE_BUILD_TYPE )
set ( CMAKE_BUILD_TYPE DEBUG )
endif()
add_subdirectory ( labhelper )
add_subdirectory ( lab1-rasterization )
add_subdirectory ( lab2-textures )
add_subdirectory ( lab3-camera )
add_subdirectory ( lab4-shading )
add_subdirectory ( lab5-rendertotexture )
add_subdirectory ( lab6-shadowmaps )
add_subdirectory ( pathtracer )
add_subdirectory ( project )