-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
109 lines (87 loc) · 2.38 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
cmake_minimum_required (VERSION 3.0)
set (SKIP_GLSLANG_INSTALL true)
set (SPIRV_SKIP_TESTS true)
set (SPIRV_CROSS_ENABLE_TESTS false)
set (SPIRV_CROSS_SKIP_INSTALL true)
set (SPIRV_CROSS_STATIC true)
project(VkInline)
set (INCLUDE_DIR
thirdparty
thirdparty/volk
thirdparty/glslang
thirdparty/SPIRV-Cross
thirdparty/Vulkan-Headers/include
thirdparty/crc64
thirdparty/unqlite
thirdparty/Vulkan_utils
.
./internal
)
if (WIN32)
set (DEFINES ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"
-D"_SCL_SECURE_NO_DEPRECATE"
-D"_CRT_SECURE_NO_WARNINGS"
)
else()
add_definitions(-std=c++17)
add_compile_options(-fPIC)
endif()
add_definitions(-D"VK_ENABLE_BETA_EXTENSIONS")
include_directories(${INCLUDE_DIR})
add_subdirectory(thirdparty/volk)
add_subdirectory(thirdparty/glslang)
add_subdirectory(thirdparty/SPIRV-Cross)
set (LIB_SOURCES
thirdparty/crc64/crc64.cpp
thirdparty/Vulkan_utils/vk_format_utils.cpp
internal/internal_context.cpp
glslc.cpp
Context.cpp
SVBuffer.cpp
SVCombine.cpp
SVObjBuffer.cpp
)
set (LIB_HEADERS
ShaderViewable.h
Context.h
SVBuffer.h
SVCombine.h
SVObjBuffer.h
Context_ex.h
Context_ex.inl
)
set(INTERNAL_HEADERS
thirdparty/crc64/crc64.h
internal/internal_context.h
internal/impl_context.inl
internal/impl_context_ex.inl
internal/internal_context_ex.h
internal/internal_context_ex.inl
)
add_definitions(${DEFINES})
add_library(unqlite STATIC thirdparty/unqlite/unqlite.h thirdparty/unqlite/unqlite.c)
add_library(VkInline ${LIB_SOURCES} ${LIB_HEADERS} ${INTERNAL_HEADERS})
target_link_libraries(VkInline volk glslang SPIRV spirv-cross-glsl unqlite)
add_library(VkInlineEX ${LIB_SOURCES} ${LIB_HEADERS} ${INTERNAL_HEADERS})
target_compile_definitions(VkInlineEX PUBLIC _VkInlineEX)
target_link_libraries(VkInlineEX volk glslang SPIRV spirv-cross-glsl unqlite)
if (WIN32)
else()
target_link_libraries(VkInline dl)
target_link_libraries(VkInlineEX dl)
endif()
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ../install CACHE PATH "Install path" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
install(FILES ${LIB_HEADERS} DESTINATION include)
install(TARGETS VkInline DESTINATION lib)
install(TARGETS VkInlineEX DESTINATION lib)
set(VKINLINE_BUILD_TESTS false CACHE BOOL "Build tests")
if (VKINLINE_BUILD_TESTS)
add_subdirectory(test)
endif()
set(BUILD_PYTHON_BINDINGS true CACHE BOOL "Build Python Bindings")
if (BUILD_PYTHON_BINDINGS)
add_subdirectory(python)
endif()