-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
executable file
·89 lines (72 loc) · 1.85 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
cmake_minimum_required(VERSION 3.7)
project(ShadeApp)
include(FetchContent)
set(CMAKE_CXX_STANDARD 17)
# Default to release build
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# If release build, enable full compiler optimisation
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
include_directories(include)
# Check if library was found
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
FetchContent_Declare(
glfw3
GIT_REPOSITORY https://github.com/glfw/glfw
GIT_TAG 3.3
)
FetchContent_MakeAvailable(glfw3)
# Get GLM
FetchContent_Declare(
glm
GIT_REPOSITORY https://github.com/g-truc/glm
)
set(GLM_TEST_ENABLE OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(glm)
find_package(Vulkan REQUIRED)
file(GLOB Shade_SRC
"src/*.cpp"
"src/*/*.cpp"
"src/*/*/*.cpp"
)
file(GLOB Shade_INC
"include/*.hpp"
"include/*/*.hpp"
"include/*/*/*.hpp"
)
## Note: May use in future for GLSL integration
#FetchContent_Declare(
# SPIRV_Headers
# GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Headers
#)
#
#FetchContent_Declare(
# SPIRV_Tools
# GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Tools
#)
#
#FetchContent_Declare(
# glslang
# GIT_REPOSITORY https://github.com/KhronosGroup/glslang
#)
#
#FetchContent_Declare(
# shaderc
# GIT_REPOSITORY https://github.com/google/shaderc
#)
#
#FetchContent_MakeAvailable(SPIRV_Headers)
#FetchContent_MakeAvailable(SPIRV_Tools)
#FetchContent_MakeAvailable(glslang)
#
#set(SHADERC_SKIP_TESTS on)
#FetchContent_MakeAvailable(shaderc)
#FetchContent_MakeAvailable(shaderc)
add_library(Shade ${Shade_SRC} ${Shade_INC})
target_link_libraries(Shade glfw glm Vulkan::Vulkan)
target_include_directories(Shade INTERFACE include)
# Example Programs:
add_subdirectory("examples" "${CMAKE_BINARY_DIR}/examples")