cmake_minimum_required(VERSION 4.1)
project(basic-vcs)

include(FetchContent)
FetchContent_Declare(ZStrGitRepo
        GIT_REPOSITORY    "https://github.com/mateidavid/zstr" # can also be a local filesystem path!
        GIT_TAG           "master"
)
FetchContent_MakeAvailable(ZStrGitRepo) # defines INTERFACE target 'zstr::zstr'

set(CMAKE_CXX_STANDARD 23)

add_executable(basic-vcs src/main.cpp
        include/sha1.hpp
        include/init.h
        include/cat-file.h
        include/commands.h
        include/ls-tree.h
        include/write-tree.h
        src/commands/cat-file.cpp
        src/commands/init.cpp
        src/commands/ls-tree.cpp
        src/commands/write-tree.cpp
        src/commands/hash-object.cpp
        include/hash-object.h
        src/commands/clone.cpp
        include/clone.h)

target_link_libraries(basic-vcs zstr::zstr)
target_include_directories(basic-vcs PRIVATE include)