Warning, /acts/cmake/ActsRetrieveVersion.cmake is written in an unsupported language. File is not indexed.
0001 # Retrieve version identification.
0002 #
0003 # Must be included from the main CMakeLists file. Sets the following variables:
0004 #
0005 # - _acts_version
0006 # - _acts_commit_hash
0007 #
0008
0009 # read version number from file
0010 file(READ "version_number" _acts_version)
0011 string(STRIP "${_acts_version}" _acts_version)
0012
0013 # read commit hash from git
0014 include(GetGitRevisionDescription)
0015 get_git_head_revision(_git_refspec _git_hash)
0016 string(SUBSTRING "${_git_hash}" 0 9 _git_hash_short)
0017 git_local_changes(_git_local_changes)
0018 if(_git_local_changes STREQUAL "CLEAN")
0019 set(_acts_commit_hash "${_git_hash}")
0020 set(_acts_commit_hash_short "${_git_hash_short}")
0021 else()
0022 set(_acts_commit_hash "${_git_hash}-dirty")
0023 set(_acts_commit_hash_short "${_git_hash_short}-dirty")
0024 endif()
0025
0026 # remove temporary variables
0027 unset(_git_refspec)
0028 unset(_git_hash)
0029 unset(_git_hash_short)
0030 unset(_git_local_changes)