2020-01-30 08:15:10 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
|
|
|
|
project(VulkanBootstrap)
|
|
|
|
|
|
|
|
find_package(Vulkan REQUIRED)
|
|
|
|
|
2020-01-31 22:23:22 +00:00
|
|
|
add_library(vk-bootstrap src/VkBootstrap.h src/VkBootstrap.cpp)
|
2020-01-30 08:15:10 +00:00
|
|
|
|
|
|
|
target_include_directories(vk-bootstrap PUBLIC src)
|
|
|
|
|
|
|
|
target_include_directories(vk-bootstrap PRIVATE ${Vulkan_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(vk-bootstrap PRIVATE ${Vulkan_LIBRARIES})
|
|
|
|
|
|
|
|
target_compile_features(vk-bootstrap PUBLIC cxx_std_11)
|
|
|
|
|
2020-01-30 08:15:10 +00:00
|
|
|
option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF)
|
2020-01-30 08:15:10 +00:00
|
|
|
|
2020-01-30 08:15:10 +00:00
|
|
|
if (VK_BOOTSTRAP_TEST)
|
2020-01-30 08:15:10 +00:00
|
|
|
|
2020-01-30 08:15:10 +00:00
|
|
|
add_subdirectory(ext/glfw)
|
|
|
|
add_subdirectory(ext/Catch2)
|
2020-01-30 08:15:10 +00:00
|
|
|
|
|
|
|
add_executable(vk-bootstrap-test tests/run_tests.cpp)
|
|
|
|
|
|
|
|
target_link_libraries(vk-bootstrap-test vk-bootstrap)
|
2020-01-30 08:15:10 +00:00
|
|
|
target_link_libraries(vk-bootstrap-test glfw)
|
2020-01-31 22:23:22 +00:00
|
|
|
target_link_libraries(vk-bootstrap-test Catch2)
|
2020-01-30 08:15:10 +00:00
|
|
|
|
2020-02-04 03:34:46 +00:00
|
|
|
add_executable(vk-bootstrap-triangle example/triangle.cpp)
|
2020-02-03 23:23:47 +00:00
|
|
|
target_link_libraries(vk-bootstrap-triangle vk-bootstrap)
|
|
|
|
target_link_libraries(vk-bootstrap-triangle glfw)
|
|
|
|
|
|
|
|
add_custom_command(
|
2020-02-04 03:34:46 +00:00
|
|
|
TARGET vk-bootstrap-triangle POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/example/shaders ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}
|
2020-02-03 23:23:47 +00:00
|
|
|
)
|
2020-01-31 22:23:22 +00:00
|
|
|
endif()
|