function(bigfoot_create_package_lib PackagePublicDependencies PackagePrivateDependencies PackageBigfootPublicDependencies PackageBigfootPrivateDependencies ParentFolder)
    add_library(${PROJECT_NAME} STATIC)

    target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

    bigfoot_compile_flatbuffers("${PackageBigfootPublicDependencies}")

    file(GLOB_RECURSE _SOURCES
            CONFIGURE_DEPENDS
            ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
    )

    file(GLOB_RECURSE _HEADERS
            CONFIGURE_DEPENDS
            ${CMAKE_CURRENT_SOURCE_DIR}/*.h
            ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
    )

    file(GLOB_RECURSE _OTHERS
            CONFIGURE_DEPENDS
            ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp.in
            ${CMAKE_CURRENT_SOURCE_DIR}/*.fbs
            ${CMAKE_CURRENT_SOURCE_DIR}/*.sql
    )

    target_sources(${PROJECT_NAME}
        PRIVATE
            ${_SOURCES}
            ${_OTHERS}
        PUBLIC
            FILE_SET HEADERS
            BASE_DIRS
                ${CMAKE_CURRENT_SOURCE_DIR}/Include
            FILES
                ${_HEADERS}
    )

    target_link_libraries(${PROJECT_NAME}
        PRIVATE
            BigfootCompileAndLinkFlags
        PUBLIC
            unordered_dense::unordered_dense
            EASTL::EASTL
            flatbuffers::flatbuffers
            rapidhash::rapidhash
            
            ${PackagePublicDependencies}
            $<LINK_LIBRARY:WHOLE_ARCHIVE,${PackageBigfootPublicDependencies}>

        PRIVATE
            ${PackagePrivateDependencies}
            $<LINK_LIBRARY:WHOLE_ARCHIVE,${PackageBigfootPrivateDependencies}>)

    source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX Src FILES ${_SOURCES} ${_HEADERS} ${_OTHERS})

    set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Bigfoot/${ParentFolder})
endfunction()

function(bigfoot_create_package_tests ParentFolder BigfootDependencies)
    add_executable(${PROJECT_NAME})

    target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

    bigfoot_compile_flatbuffers("${BigfootDependencies}")

    file(GLOB_RECURSE _SOURCES
            CONFIGURE_DEPENDS
            ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
    )

    file(GLOB_RECURSE _HEADERS
            CONFIGURE_DEPENDS
            ${CMAKE_CURRENT_SOURCE_DIR}/*.h
            ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
    )

    file(GLOB_RECURSE _OTHERS
            CONFIGURE_DEPENDS
            ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp.in
            ${CMAKE_CURRENT_SOURCE_DIR}/*.fbs
            ${CMAKE_CURRENT_SOURCE_DIR}/*.sql
    )

    target_sources(${PROJECT_NAME}
        PRIVATE
            ${_SOURCES}
            ${_OTHERS}
        PUBLIC
            FILE_SET HEADERS
            BASE_DIRS
                ${CMAKE_CURRENT_SOURCE_DIR}/Include
            FILES
                ${_HEADERS}
    )

    target_link_libraries(${PROJECT_NAME}
        PRIVATE
            BigfootCompileAndLinkFlags

        PRIVATE
            $<LINK_LIBRARY:WHOLE_ARCHIVE,${PackageName}>
            gtest::gtest)

    include(GoogleTest)
    gtest_discover_tests(${PROJECT_NAME} XML_OUTPUT_DIR ${CMAKE_BINARY_DIR}/TestResults/)

    source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX Src/ FILES ${_SOURCES} ${_HEADERS} ${_OTHERS})

    set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Tests/Bigfoot/${ParentFolder})

    set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:${PROJECT_NAME}>")

    ##################COPY FIXTURE FOLDER###################

    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Fixture)
        file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Fixture)
    endif()

    # Track all fixture files
    file(GLOB_RECURSE FIXTURE_FILES
            CONFIGURE_DEPENDS
            ${CMAKE_CURRENT_SOURCE_DIR}/Fixture/*
    )

    add_custom_target(${PROJECT_NAME}Fixture
            COMMAND ${CMAKE_COMMAND} -E remove_directory $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture
            COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Fixture $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture
            DEPENDS ${FIXTURE_FILES}
            COMMENT "Copying Fixture folder for ${PROJECT_NAME}"
    )

    add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}Fixture)

    set_target_properties(${PROJECT_NAME}Fixture PROPERTIES FOLDER UtilityTargets/Tests/Bigfoot/${ParentFolder})
endfunction()