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
find_package (Vulkan REQUIRED)

add_library(planet-vk
        commands.cpp
        descriptors.cpp
        frame_buffer.cpp
        image.cpp
        init.cpp
        memory.cpp
        pipeline.cpp
        render_pass.cpp
        shader-pipeline.cpp
        surface.cpp
        swap_chain.cpp
        synchronisation.cpp
        texture.cpp
    )
target_include_directories(planet-vk PUBLIC ../include)
target_link_libraries(planet-vk PUBLIC
        planet-sdl
        Vulkan::Vulkan
    )
if (PLANET_VK_VALIDATION)
    target_compile_definitions(planet-vk PRIVATE
        PLANET_VK_VALIDATION=1)
endif()


add_library(planet-vk-sdl
        sdl.cpp
    )
target_link_libraries(planet-vk-sdl planet-vk)


add_library(planet-vk-engine
        app.engine.cpp
        attachments.engine.cpp
        blank.engine.cpp
        mesh.pipeline.cpp
        renderer.engine.cpp
        sprite.pipeline.cpp
        textured.pipeline.cpp
    )
vk_shader(planet-vk-engine mesh.frag)
vk_shader(planet-vk-engine mesh.screen.vert)
vk_shader(planet-vk-engine mesh.world.vert)
vk_shader(planet-vk-engine sprite.frag)
vk_shader(planet-vk-engine sprite.screen.vert)
vk_shader(planet-vk-engine sprite.world.vert)
vk_shader(planet-vk-engine textured.frag)
vk_shader(planet-vk-engine texture.screen.vert)
vk_shader(planet-vk-engine texture.world.vert)
target_link_libraries(planet-vk-engine planet-vk-sdl)


install(FILES
        ${CMAKE_CURRENT_BINARY_DIR}/mesh.frag.spirv
        ${CMAKE_CURRENT_BINARY_DIR}/mesh.screen.vert.spirv
        ${CMAKE_CURRENT_BINARY_DIR}/mesh.world.vert.spirv
        ${CMAKE_CURRENT_BINARY_DIR}/sprite.frag.spirv
        ${CMAKE_CURRENT_BINARY_DIR}/sprite.screen.vert.spirv
        ${CMAKE_CURRENT_BINARY_DIR}/sprite.world.vert.spirv
        ${CMAKE_CURRENT_BINARY_DIR}/textured.frag.spirv
        ${CMAKE_CURRENT_BINARY_DIR}/texture.screen.vert.spirv
        ${CMAKE_CURRENT_BINARY_DIR}/texture.world.vert.spirv
    DESTINATION share/planet-vk-engine)