-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
78 lines (67 loc) · 2.03 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
cmake_minimum_required(VERSION 3.10)
file(READ .version engine_version)
project(vkaEngineProject
VERSION ${engine_version})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(BUILD_SHARED_LIBS OFF)
set(src_dir ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(bin_dir ${CMAKE_CURRENT_BINARY_DIR})
# Download automatically, you can also just copy the conan.cmake file
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://github.com/conan-io/cmake-conan/raw/v0.13/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(CONANFILE conanfile.py
BASIC_SETUP
PROFILE $ENV{CONANPROFILE}
BUILD missing)
##
## Modules
##
add_library(vkaEngine)
target_link_libraries(vkaEngine PUBLIC ${CONAN_LIBS})
add_executable(vka_tests ${src_dir}/catch_main.cpp)
target_link_libraries(vka_tests PRIVATE vkaEngine)
function(add_module module_name)
set(module_source ${src_dir}/${module_name}.cpp)
set(test_name ${module_name}.test)
set(test_source ${src_dir}/${test_name}.cpp)
if(EXISTS ${module_source})
target_sources(vkaEngine PRIVATE ${module_source})
endif()
if(EXISTS ${test_source})
target_sources(vka_tests PRIVATE ${test_source})
endif()
endfunction()
add_module(variant_helper)
add_module(io)
add_module(logger)
add_module(sync_helper)
add_module(platform_glfw)
add_module(instance)
add_module(physical_device)
add_module(surface)
add_module(input)
add_module(queue_family)
add_module(device)
add_module(memory_allocator)
add_module(queue)
add_module(swapchain)
add_module(descriptor_set_layout)
add_module(descriptor_pool)
add_module(descriptor_set)
add_module(command_pool)
add_module(command_buffer)
add_module(render_pass)
add_module(pipeline_layout)
add_module(shader_module)
add_module(buffer)
add_module(image)
add_module(image_view)
add_module(fence)
add_module(semaphore)
add_module(framebuffer)
add_module(sampler)
add_module(pipeline)