#
# Make a version file that includes the ArrayFire version and git revision
#
SET(AF_VERSION_MAJOR "3")
SET(AF_VERSION_MINOR "0")
SET(AF_VERSION_PATCH "2")

SET(AF_VERSION "${AF_VERSION_MAJOR}.${AF_VERSION_MINOR}.${AF_VERSION_PATCH}")
EXECUTE_PROCESS(
    COMMAND git log -1 --format=%h
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    OUTPUT_VARIABLE GIT_COMMIT_HASH
    OUTPUT_STRIP_TRAILING_WHITESPACE
)

CONFIGURE_FILE(
    ${CMAKE_MODULE_PATH}/version.h.in
    ${CMAKE_SOURCE_DIR}/include/af/version.h
)
