generated from fluffels/vk-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (58 loc) · 1.8 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
cmake_minimum_required (VERSION 3.7)
set (CMAKE_CXX_STANDARD 17)
project (vk-template)
set(VCPKG "C:/vcpkg/")
set(CMAKE_TOOLCHAIN_FILE "${VCPKG}/scripts/buildsystems/vcpkg.cmake")
include_directories(${VCPKG}installed/x64-windows/include)
link_directories(${VCPKG}installed/x64-windows/lib)
# add_definitions(-DVULKAN_MESH_SHADER)
# add_definitions(-DVULKAN_PERFORMANCE_COUNTERS)
find_package(Vulkan REQUIRED)
set(GLSL_VALIDATOR "$ENV{VULKAN_SDK}/Bin/glslc.exe")
file(GLOB_RECURSE GLSL_FILES "shaders/*.vert" "shaders/*.frag" "shaders/*.mesh")
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)
include_directories(${CMAKE_HOME_DIRECTORY}/lib/easyloggingpp/src)
include_directories(${CMAKE_HOME_DIRECTORY}/lib/jcwk)
include_directories(${glm_INCLUDE_DIRS})
include_directories(${Vulkan_INCLUDE_DIRS})
set(PLATFORM_INDEPENDENT_FILES
lib/jcwk/FileSystem.cpp
lib/jcwk/Vulkan.cpp
lib/SPIRV-Reflect/spirv_reflect.c
lib/easyloggingpp/src/easylogging++.cc
src/RenderMesh.cpp
src/RenderPostProcess.cpp
src/RenderText.cpp
src/Render.cpp
src/State.cpp
)
IF (WIN32)
add_executable(
main
WIN32
Shaders
src/MainWin32.cpp
lib/jcwk/Win32/DirectInput.cpp
lib/jcwk/Win32/Controller.cpp
lib/jcwk/Win32/Mouse.cpp
${PLATFORM_INDEPENDENT_FILES}
)
ENDIF()
target_link_libraries(
main
${Vulkan_LIBRARIES}
dinput8.lib
dxguid.lib
openvr_api
)