# Adds Volk using FetchContent.
#
# Uses:
# VOLK_FETCH_CONTENT_VERSION (optional): Lets you select the Volk version if you use fetch content.
#
# Defines:
# VOLK_FOUND: true if the header was found successfully.
# VOLK_HEADERS (only if VKMEMALLOC_FOUND is true): the directory containing the 'vk_mem_alloc.h' file.

if(NOT VOLK_FETCH_CONTENT_VERSION)
	set(VOLK_FETCH_CONTENT_VERSION 1.2.170)
endif()
include(FetchContent)
FetchContent_Declare(
		VOLK
		GIT_REPOSITORY	https://github.com/zeux/volk
		GIT_TAG			${VOLK_FETCH_CONTENT_VERSION}
)
if(NOT volk_POPULATED)
	FetchContent_Populate(VOLK)
endif()
set(VOLK_INCLUDE_DIR "${volk_SOURCE_DIR}")

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Volk DEFAULT_MSG VOLK_INCLUDE_DIR)
if(Volk_FOUND)
	set(VOLK_HEADERS ${VOLK_INCLUDE_DIR})
endif()