find_package(Git QUIET)
if( GIT_FOUND )
  execute_process(
    COMMAND ${GIT_EXECUTABLE} describe --tags --match "metaSMT-*" HEAD
    OUTPUT_VARIABLE GIT_VERSION_DESCRIPTION
    OUTPUT_STRIP_TRAILING_WHITESPACE
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
    ERROR_QUIET
    RESULT_VARIABLE GIT_DESCRIBE_RESULT
  )

  if(GIT_DESCRIBE_RESULT EQUAL 0)
  string(REPLACE "metaSMT-" "" metaSMT_VERSION "${GIT_VERSION_DESCRIPTION}")
  endif()

  message(STATUS "metaSMT VERSION: ${metaSMT_VERSION}" )
endif()

