BareGit
cmake_minimum_required(VERSION 3.24)
project(telegrammer)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_EXTENSIONS OFF)

# Dependencies
include(FetchContent)

FetchContent_Declare(
  libmw
  GIT_REPOSITORY https://github.com/MetroWind/libmw.git
)

FetchContent_Declare(
  spdlog
  GIT_REPOSITORY https://github.com/gabime/spdlog.git
  GIT_TAG v1.12.0
)

FetchContent_Declare(
  json
  GIT_REPOSITORY https://github.com/nlohmann/json.git
  GIT_TAG v3.11.3
)

FetchContent_Declare(
  cxxopts
  GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
  GIT_TAG v3.1.1
)

set(SPDLOG_USE_STD_FORMAT ON)
set(LIBMW_BUILD_URL ON)
set(LIBMW_BUILD_HTTP_SERVER ON)
FetchContent_MakeAvailable(libmw spdlog json cxxopts)

add_executable(telegrammer src/main.cpp)

target_link_libraries(telegrammer PRIVATE 
    mw::mw 
    mw::http-server 
    mw::url 
    nlohmann_json::nlohmann_json 
    spdlog::spdlog
    cxxopts
)

target_include_directories(telegrammer PRIVATE 
    ${libmw_SOURCE_DIR}/includes
)

target_compile_options(telegrammer PRIVATE -Wall -Wextra -Wpedantic)