include(vcpkg_common_functions)
set(SRANIPAL_VERSION 1.1.0.1)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)

file(READ "${VCPKG_ROOT_DIR}/_env/EXTERNAL_SRANIPAL_URLS.txt" EXTERNAL_SRANIPAL_URLS)
file(READ "${VCPKG_ROOT_DIR}/_env/EXTERNAL_SRANIPAL_SHA512.txt" EXTERNAL_SRANIPAL_SHA512)

if (WIN32)
    vcpkg_download_distfile(
        SRANIPAL_SOURCE_ARCHIVE
        URLS ${EXTERNAL_SRANIPAL_URLS}
        SHA512 ${EXTERNAL_SRANIPAL_SHA512}
        FILENAME sranipal-1.1.0.1-2-windows.zip
    )

    vcpkg_extract_source_archive(${SRANIPAL_SOURCE_ARCHIVE})
    file(COPY ${MASTER_COPY_SOURCE_PATH}/sranipal/include DESTINATION ${CURRENT_PACKAGES_DIR})
    file(COPY ${MASTER_COPY_SOURCE_PATH}/sranipal/lib DESTINATION ${CURRENT_PACKAGES_DIR})
    file(COPY ${MASTER_COPY_SOURCE_PATH}/sranipal/debug DESTINATION ${CURRENT_PACKAGES_DIR})
    file(COPY ${MASTER_COPY_SOURCE_PATH}/sranipal/bin DESTINATION ${CURRENT_PACKAGES_DIR})
    file(COPY ${MASTER_COPY_SOURCE_PATH}/sranipal/share DESTINATION ${CURRENT_PACKAGES_DIR})

endif ()
