This repository has been archived by the owner on Mar 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
74 lines (55 loc) · 2.41 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
cmake_minimum_required(VERSION 2.8)
project(sigrlinn)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
find_package(D3D11 REQUIRED)
#find_package(D3D12)
set(SGFX_USE_D3D11_1 FALSE CACHE BOOL "Use D3D11.1 features")
if(SGFX_USE_D3D11_1)
add_definitions("/DSGFX_USE_D3D11_1=1")
endif()
file(GLOB src sigrlinn/*.cc)
file(GLOB hdr sigrlinn/*.hh)
file(GLOB demo_common_src demo/common/*.cc)
file(GLOB demo_common_hdr demo/common/*.hh)
file(GLOB demo_src demo/*.cc)
file(GLOB demo_hdr demo/*.hh)
source_group("source" FILES ${src})
source_group("include" FILES ${hdr})
source_group("glew" FILES sigrlinn/GL/glew.c sigrlinn/GL/glew.h sigrlinn/GL/glxew.h sigrlinn/GL/wglew.h)
source_group("demo\\common\\source" FILES ${demo_common_src})
source_group("demo\\common\\include" FILES ${demo_common_hdr})
source_group("demo\\source" FILES ${demo_src})
source_group("demo\\include" FILES ${demo_hdr})
set(SGFX_GLEW_SRC
sigrlinn/GL/glew.c
sigrlinn/GL/glew.h
sigrlinn/GL/glxew.h
sigrlinn/GL/wglew.h
)
include_directories(${CMAKE_SOURCE_DIR}/sigrlinn)
include_directories(${CMAKE_SOURCE_DIR}/external/glm/)
include_directories(${CMAKE_SOURCE_DIR}/external/)
if(D3D12_FOUND)
message("D3D12 found")
add_library(SigrlinnD3D12 ${hdr} sigrlinn/sigrlinn_d3d12.cc)
endif()
add_library(SigrlinnD3D11 ${hdr} sigrlinn/sigrlinn_d3d11.cc)
add_library(SigrlinnGL4 ${hdr} ${SGFX_GLEW_SRC} sigrlinn/sigrlinn_gl4.cc)
function(AddDemo Name Source)
add_executable(${Name}D3D11 WIN32 ${Source} ${demo_common_src} ${demo_common_hdr} demo/win32_app.cc)
target_link_libraries(${Name}D3D11 SigrlinnD3D11)
#if(D3D12_FOUND)
# add_executable(${Name}D3D12 WIN32 ${Source} ${demo_common_src} ${demo_common_hdr} demo/win32_app.cc)
# target_link_libraries(${Name}D3D12 SigrlinnD3D11)
#endif()
#add_executable(${Name}GL4 ${Source} ${demo_common_src} ${demo_common_hdr} demo/win32_app.cc)
#target_link_libraries(${Name}GL4 SigrlinnGL4)
endfunction()
AddDemo(GrassDemo demo/demo_grass.cc)
AddDemo(CubeDemo demo/demo_cube.cc)
AddDemo(PBR demo/demo_pbr.cc)
AddDemo(Particles demo/demo_particles.cc)
AddDemo(OIT demo/demo_oit.cc)
AddDemo(CMRS demo/demo_cmrs.cc)
AddDemo(FFD demo/demo_ffd.cc)
#AddDemo(Terrain demo/demo_terrain.cc)