-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
46 lines (35 loc) · 1.4 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
cmake_minimum_required(VERSION 3.14)
project(DX_Renderer VERSION 0.0.1)
set(warnings "/W4 /WX /EHsc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd26812")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /nologo /Oi")
file(GLOB_RECURSE SRCS
"DX_Renderer/*.cpp"
"DX_Renderer/*.hpp"
"DX_Renderer/*.h")
add_compile_definitions(WIN32_LEAN_AND_MEAN)
add_executable(${CMAKE_PROJECT_NAME} WIN32 DX_Renderer/main.cpp ${SRCS})
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 17)
target_link_libraries(DX_Renderer PRIVATE
"d3d12.lib"
"dxgi.lib"
"d3dcompiler.lib"
"windowscodecs.lib"
"dxcompiler.lib"
"./DX_Renderer/ThirdParty/VXGI/GFSDK_VXGI_x64"
"./DX_Renderer/ThirdParty/NVAPI/nvapi64")
add_custom_command(
TARGET DX_Renderer PRE_BUILD #Adds a post-build event
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/DX_Renderer/ThirdParty/DXC/dxcompiler.dll"
$<TARGET_FILE_DIR:DX_Renderer>)
add_custom_command(
TARGET DX_Renderer PRE_BUILD #Adds a post-build event
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/DX_Renderer/ThirdParty/DXC/dxil.dll"
$<TARGET_FILE_DIR:DX_Renderer>)
add_custom_command(
TARGET DX_Renderer PRE_BUILD #Adds a post-build event
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/DX_Renderer/ThirdParty/VXGI/GFSDK_VXGI_x64.dll"
$<TARGET_FILE_DIR:DX_Renderer>)