NMEA: sentence ZFI added
[marnav.git] / cmake / RepoInformation.cmake
blob1c3d12e20d1a5f7bb28956202d10b876909b887f
1 include(GitInformation)
3 if(GIT_FOUND)
4         git_check_repository(GIT_REPO_FOUND)
5         if(GIT_REPO_FOUND)
6                 git_commit_hash(GIT_COMMIT_HASH GIT_COMMIT_HASH_SHORT)
7                 git_branch_name(GIT_BRANCH)
8                 message(STATUS "git branch: ${GIT_BRANCH}")
9                 message(STATUS "git commit hash: ${GIT_COMMIT_HASH}")
11                 # version handling if repository information is available
12                 git_head_tag(GIT_HEAD_TAG)
13                 message(STATUS "git head tag: ${GIT_HEAD_TAG}")
14                 if("${GIT_HEAD_TAG}" STREQUAL "")
15                         set(PROJECT_VERSION "${PROJECT_VERSION}-${GIT_COMMIT_HASH_SHORT}")
16                 elseif(NOT ("${GIT_HEAD_TAG}" MATCHES "[v]?[0-9]+\..*"))
17                         set(PROJECT_VERSION "${PROJECT_VERSION}-${GIT_HEAD_TAG}")
18                 endif()
19         else()
20                 message(STATUS "no git repository found, no further version info available")
21         endif()
22 else()
23         message(STATUS "git not found, no further version info available")
24 endif()
25 message(STATUS "Project Version: ${PROJECT_VERSION}")