cmake_minimum_required(VERSION 3.20) project(hdk-sdl VERSION 0.0.0 LANGUAGES CXX ) # hdk-sdl OPTIONS option(HDK_SDL_BUILD_TESTS "Build hdk-sdl tests" OFF) # TODO: Unit testing if(HDK_SDL_BUILD_TESTS) message(WARNING "hdk-sdl tests are not implemented yet.") endif() option(HDK_SDL_BUILD_EXAMPLES "Build hdk-sdl examples" OFF) if(HDK_SDL_BUILD_EXAMPLES) add_subdirectory(examples) endif() option(HDK_SDL_BUILD_COVERAGE "Build hdk-sdl with coverage reporting enabled" OFF) if(HDK_SDL_BUILD_COVERAGE) message(WARNING "hdk-sdl coverage testing is not implemented yet.") endif() # TODO: Coverage testing # 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 http://github.com/libsdl-org/SDL.git GIT_TAG release-3.4.0 ) 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)