GET_FILENAME_COMPONENT(SRC_DIR ${SRC} DIRECTORY)

IF (GIT_EXECUTABLE AND NOT DEFINED KERFUFFLE_VERSION)
  EXECUTE_PROCESS(
      COMMAND ${GIT_EXECUTABLE} describe --tags --dirty --match "v*"
      WORKING_DIRECTORY ${SRC_DIR}
      OUTPUT_VARIABLE GIT_DESCRIBE_VERSION
      OUTPUT_STRIP_TRAILING_WHITESPACE
      ERROR_QUIET
  )
  IF (NOT GIT_DESCRIBE_VERSION)
    SET(KERFUFFLE_VERSION ${GIT_DESCRIBE_VERSION})
  ENDIF ()
ENDIF ()

IF (NOT GIT_DESCRIBE_VERSION)
  #  STRING(TIMESTAMP BUILD_TIME_STAMP "%Y-%m-%dT%H:%M:%SZ")
  #  SET(KERFUFFLE_VERSION ${BUILD_TIME_STAMP})
  SET(KERFUFFLE_VERSION "dev")
ENDIF ()

MESSAGE("ℹ️ using KERFUFFLE_VERSION: " ${KERFUFFLE_VERSION})

CONFIGURE_FILE(${SRC} ${DST} @ONLY)