cmake_minimum_required(VERSION 3.19.0)

include(contrib/util.cmake)
load_crossbow_version(CROSSBOW_VERSION PROJECT_VERSION_FULL)

project(Crossbow
    VERSION ${CROSSBOW_VERSION}
    DESCRIPTION "the minimalist feed aggregator"
    HOMEPAGE_URL "https://dacav.org/projects/crossbow/"
    LANGUAGES C
)

option(UT_SAN "Use sanitizers on unit tests" OFF)
option(STRICT "Enable strict compiler flags" OFF)

find_package(PkgConfig REQUIRED)
pkg_check_modules(MRSS REQUIRED IMPORTED_TARGET mrss)
pkg_check_modules(CURL REQUIRED IMPORTED_TARGET libcurl)
find_package(OpenSSL REQUIRED)

find_path(UTHASH_H_INCLUDE uthash.h REQUIRED)

add_compile_options(-Wall)
if (STRICT)
    add_compile_options(-Werror)
endif()

add_subdirectory(src)
add_subdirectory(man)

enable_testing()
add_subdirectory(unit-tests)
