cmake_minimum_required(VERSION 3.20)

project(hdk-sdl 
  VERSION 0.0.1
  LANGUAGES CXX
  DESCRIPTION "header only shared_ptr wrappers around SDL3 structs and functions"
)

# Note: The src/ directory contains Doxygen documentation-only .cpp files.
# This is a header-only library; src/ files are not compiled into any targets.

# hdk-sdl OPTIONS
option(HDK_SDL_TESTS "Build hdk-sdl tests" ${HDK_TESTS})
option(HDK_SDL_EXAMPLES "Build hdk-sdl examples" ${HDK_EXAMPLES})
if(HDK_SDL_EXAMPLES)
  add_subdirectory(examples)
endif()

# FOR SDL Building
set(SDL_TEST OFF CACHE BOOL "Disable SDL tests" FORCE)
set(SDL_EXAMPLES OFF CACHE BOOL "Disable SDL examples" FORCE)
set(SDL_INSTALL OFF CACHE BOOL "Disable SDL install" FORCE)
# NOTE: Possibly disable SDL_PIPEWIRE and/or SDL_PIPEWIRE_SHARED?
include(FetchContent)
FetchContent_Declare(
  SDL3
  GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
  GIT_TAG release-3.4.8
)
FetchContent_MakeAvailable(SDL3)

add_library(hdk-sdl INTERFACE)
target_link_libraries(hdk-sdl INTERFACE SDL3::SDL3 hdk-grid)
target_include_directories(hdk-sdl INTERFACE ${SDL3_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_compile_features(hdk-sdl INTERFACE cxx_std_17)

if(HDK_SDL_TESTS)
  add_subdirectory(test)
endif()

