# Everything the breeze CLI does that is not reading a command line: finding
# and reading projects and their SDK, running the SDK's scripts, editing modules,
# managing CLI versions, SDKs and tools. source/Breeze registers the commands
# (with CLIForge) and calls into this; source/tests/CoreTests tests it.
#
# nlohmann/json: an installed copy (3.11 or newer) if there is one, else the
# release tarball, pinned by hash.
add_dependency(nlohmann_json
    URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
    URL_HASH SHA256=d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d
    FIND_PACKAGE_ARGS 3.11 NAMES nlohmann_json)

add_lib_module(breeze_core TYPE STATIC OUTPUT_NAME "breeze_core")

# PUBLIC: Config.hpp and Project.hpp have nlohmann::json members, so whoever includes them needs
# its headers (DEPENDS would link it PRIVATE).
target_link_libraries(breeze_core PUBLIC nlohmann_json::nlohmann_json)

# The version of the program, from the project's own (project/Configuration.cmake).
target_compile_definitions(breeze_core PRIVATE BREEZE_CLI_VERSION="${PROJECT_VERSION}")
