cmake_minimum_required(VERSION 3.28 FATAL_ERROR)

include(SetupVulkan)
include(Utils)

file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${SOURCES})
add_executable(OpenVulkano_Tests ${SOURCES})

target_include_directories(OpenVulkano_Tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

target_include_directories(OpenVulkano_Tests PRIVATE openVulkanoCpp)
target_link_libraries(OpenVulkano_Tests PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,openVulkanoCpp>")

# add catch2 
target_link_libraries(OpenVulkano_Tests PRIVATE Catch2::Catch2WithMain)
SetupVulkan(OpenVulkano_Tests)
SetGlmDefines(OpenVulkano_Tests)
SetWarningSettings(OpenVulkano_Tests)

list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras)
list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/contrib)

include(CTest)
include(Catch)
catch_discover_tests(OpenVulkano_Tests)
