add_subdirectory(spdlog-1.12.0)
add_subdirectory(restbed-4.8)

add_custom_command(
    COMMAND ./configure.py ARGS --amalgamation --disable-shared --minimized-build --enable-modules=argon2fmt,hotp,base32,auto_rng,system_rng,tls13,certstor_system,certstor_flatfile,md5
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Botan-3.2.0
    OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Botan-3.2.0/botan_all.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Botan-3.2.0/botan_all.h
)
add_library(botan STATIC Botan-3.2.0/botan_all.cpp Botan-3.2.0/botan_all.h)
target_include_directories(botan PUBLIC Botan-3.2.0)

add_library(miniz STATIC miniz/miniz.c miniz/miniz.h)
target_include_directories(miniz PUBLIC miniz)

add_library(${PROJECT_NAME}_libs INTERFACE)
target_link_libraries(${PROJECT_NAME}_libs INTERFACE
    spdlog::spdlog
    restbed-static
    botan
    miniz
)
target_include_directories(${PROJECT_NAME}_libs INTERFACE restbed-4.8/dependency/asio/asio/include Botan-3.2.0)
