set(REPOSITORY_NAME "QXlsx")
set(REPOSITORY_URL  "https://github.com/QtExcel/QXlsx.git")
set(REPOSITORY_TAG  "0461eac843358aec56c648ec929ca20da5822fdc")

FetchContent_Declare(
    "${REPOSITORY_NAME}"
    GIT_REPOSITORY "${REPOSITORY_URL}"
    GIT_TAG "${REPOSITORY_TAG}"
)

string(TOLOWER "${REPOSITORY_NAME}" REPOSITORY_NAME_TO_POPULATE)
FetchContent_MakeAvailable("${REPOSITORY_NAME_TO_POPULATE}")

set(QXLSX_ROOT "${${REPOSITORY_NAME_TO_POPULATE}_SOURCE_DIR}/${REPOSITORY_NAME}")
add_subdirectory("${QXLSX_ROOT}" ${${REPOSITORY_NAME_TO_POPULATE}_BINARY_DIR})

set(QXLSX_HEADERPATH "${QXLSX_ROOT}/header")
target_include_directories(${PROJECT_NAME} PRIVATE "${QXLSX_HEADERPATH}")
target_link_libraries(${PROJECT_NAME} PRIVATE ${REPOSITORY_NAME})
