-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
111 lines (93 loc) · 3.95 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
project(YAGF)
add_definitions(-DGLEW_STATIC)
find_package(GLEW REQUIRED)
find_package(glfw3 REQUIRED)
find_package(OpenGL REQUIRED)
find_package(Freetype)
find_package(Assimp REQUIRED)
#find_package(Vulkan REQUIRED)
option(BUILD_OPENCL "Build Sample using OpenCL" OFF)
option(BUILD_DX12 "Build Sample using DX12" OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest")
include_directories(
${GLEW_INCLUDE_DIRS}
${GLFW_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIR}
"$ENV{VULKAN_SDK}/Include"
"${FREETYPE_INCLUDE_DIRS}/freetype2"
"deps/Vulkan-Hpp/"
"deps/d3d12"
"include"
)
add_subdirectory(deps)
add_subdirectory(src)
add_subdirectory(examples)
#add_executable(ssao examples/ssao.cpp)
#target_link_libraries(ssao ${PROJECT_NAME})
#add_executable(gaussianblur examples/gaussianblur.cpp)
#target_link_libraries(gaussianblur ${PROJECT_NAME})
#add_executable(skybox examples/skybox.cpp src/glapi.cpp src/glshaders.cpp)
#target_link_libraries(skybox ${PROJECT_NAME})
#add_executable(ibl examples/ibl.cpp src/glapi.cpp src/glshaders.cpp src/ibl.cpp)
#target_link_libraries(ibl ${PROJECT_NAME})
#set_target_properties(ibl PROPERTIES COMPILE_DEFINITIONS "GLBUILD")
#add_executable(text examples/text.cpp)
#target_link_libraries(text ${PROJECT_NAME})
#add_executable(oit examples/oit.cpp)
#target_link_libraries(oit ${PROJECT_NAME})
#add_executable(mesh examples/mesh.cpp)
#target_link_libraries(mesh ${PROJECT_NAME})
#add_executable(tfx examples/TressFX/tfx.cpp examples/TressFX/common.cpp)
#target_link_libraries(tfx ${PROJECT_NAME})
if(BUILD_OPENCL)
include_directories("C:/Program Files (x86)/AMD APP SDK/3.0-0-Beta/include")
add_executable(tfx-ocl examples/TressFX/tfx-ocl.cpp examples/TressFX/common.cpp)
target_link_libraries(tfx-ocl ${PROJECT_NAME} "C:/Program Files (x86)/AMD APP SDK/3.0-0-Beta/lib/x86/OpenCL.lib")
endif()
if(BUILD_DX12)
add_executable(meshdx12 src/d3dapi.cpp src/d3dshaders.cpp examples/meshdx12.cpp examples/shaders/skinnedobject.hlsl examples/shaders/object_gbuffer.hlsl)
set_target_properties(meshdx12 PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS")
target_link_libraries(meshdx12 ${PROJECT_NAME})
add_executable(ssaodx12 src/d3dapi.cpp examples/ssaodx12.cpp examples/shaders/ssao_vtx.hlsl examples/shaders/ssao_pix.hlsl examples/shaders/screenquad.hlsl examples/shaders/linearize.hlsl)
set_target_properties(ssaodx12 PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS")
target_link_libraries(ssaodx12 ${PROJECT_NAME})
add_executable(skyboxdx12 src/d3dapi.cpp src/d3dshaders.cpp examples/skyboxdx12.cpp examples/shaders/screenquad.hlsl examples/shaders/skybox.hlsl)
set_target_properties(skyboxdx12 PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS")
target_link_libraries(skyboxdx12 ${PROJECT_NAME})
endif()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/examples/Scene/include")
#add_executable(scene
# examples/Scene/main.cpp
# examples/Scene/scene.cpp
# examples/Scene/material.cpp
# examples/Scene/meshscenenode.cpp
# examples/Scene/texturemanager.cpp
# src/glshaders.cpp
# src/ibl.cpp
# src/glapi.cpp)
#set_target_properties(scene PROPERTIES COMPILE_DEFINITIONS "GLBUILD")
#target_link_libraries(scene ${PROJECT_NAME})
if(BUILD_DX12)
add_executable(scenedx12
src/d3dapi.cpp
src/ibl.cpp
examples/Scene/main.cpp
examples/Scene/scene.cpp
examples/Scene/material.cpp
examples/Scene/meshscenenode.cpp
examples/Scene/texturemanager.cpp
examples/shaders/sunlight.hlsl
src/d3dshaders.cpp
examples/shaders/object.hlsl
examples/shaders/object_gbuffer.hlsl
examples/shaders/skybox.hlsl
examples/shaders/skyboxvert.hlsl
examples/shaders/importance_sampling_specular.hlsl
examples/shaders/computesh.hlsl
examples/shaders/ibl.hlsl
examples/shaders/tonemap.hlsl)
set_target_properties(scenedx12 PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS")
set_target_properties(scenedx12 PROPERTIES COMPILE_DEFINITIONS "DXBUILD")
target_link_libraries(scenedx12 ${PROJECT_NAME})
endif()