-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
39 lines (35 loc) · 1.04 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
cmake_minimum_required (VERSION 3.7)
set (CMAKE_CXX_STANDARD 17)
project (kwark)
find_package(Vulkan REQUIRED)
set(GLSL_VALIDATOR "$ENV{VULKAN_SDK}/Bin/glslc.exe")
file(GLOB_RECURSE GLSL_FILES "shaders/*.vert" "shaders/*.frag")
foreach(GLSL_FILE ${GLSL_FILES})
set(SPIRV_FILE "${GLSL_FILE}.spv")
add_custom_command(
OUTPUT ${SPIRV_FILE}
COMMAND ${GLSL_VALIDATOR} ${GLSL_FILE} -o ${SPIRV_FILE}
DEPENDS ${GLSL_FILE}
)
list(APPEND SPIRV_FILES ${SPIRV_FILE})
endforeach(GLSL_FILE)
add_custom_target(Shaders ALL DEPENDS ${SPIRV_FILES})
include_directories (${CMAKE_HOME_DIRECTORY}/src)
include_directories (${CMAKE_HOME_DIRECTORY}/lib/glm)
include_directories (${CMAKE_HOME_DIRECTORY}/lib)
include_directories (${CMAKE_HOME_DIRECTORY}/lib/jcwk)
include_directories(${glm_INCLUDE_DIRS})
include_directories(${Vulkan_INCLUDE_DIRS})
add_executable (
main
WIN32
Shaders
lib/SPIRV-Reflect/spirv_reflect.c
src/main.cpp
)
target_link_libraries(
main
${Vulkan_LIBRARIES}
dinput8.lib
dxguid.lib
)