cmake_minimum_required(VERSION 3.20)
project(lager-tests)

enable_testing()

find_package(Lager REQUIRED)
# aliases used by the examples
add_library(lager-example ALIAS lager)
add_library(lager-debugger-example ALIAS lager)

# find ncurses properly before the CMakeLists.txt of the examples does it;
# this will be done in the future:
# https://github.com/arximboldi/lager/pull/191
set(CURSES_NEED_WIDE true)
find_package(Curses REQUIRED)
# find SDL2 before it is done by the CMakeLists.txt of the examples,
# so the right variables for targets can be set;
# this will be done in the future:
# https://github.com/arximboldi/lager/pull/190
find_package(SDL2 REQUIRED)
find_package(SDL2_ttf REQUIRED)
set(SDL2_LIBRARY SDL2::SDL2)
set(SDL2_TTF_LIBRARIES SDL2_ttf::SDL2_ttf)

set(lager_BUILD_DEBUGGER_EXAMPLES TRUE)

add_subdirectory(examples)
