# volk is not prepared to be a DLL.
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO zeux/volk
    REF 1.3.204
    SHA512 73108aff5bed08f711730948c80070a8d913f2ba2e7886232cd981272fe47bc85cff84eabfdf14d4261c658b58ee098a9bd837222f65323f304d6abcdbeb8613
    HEAD_REF master
)

vcpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
    OPTIONS
        -DVOLK_INSTALL=ON
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/volk)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

# Put the file containing the license where vcpkg expects it
file(COPY "${SOURCE_PATH}/README.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/volk/")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/volk/README.md" "${CURRENT_PACKAGES_DIR}/share/volk/copyright")
