Commit fe2c558b authored by Brad King's avatar Brad King

CMakeVersion: Preserve Git information during 'git archive'

Use `export-subst` to get information about the Git commit used to
produce an archive.
parent 0505a66c
CMakeVersion.cmake export-subst
# Do not format third-party sources.
/kwsys/** -format.clang-format-6.0
......@@ -39,6 +39,9 @@ if(COMMAND _git)
# Get the commit checked out in this work tree.
_git(log -n 1 HEAD "--pretty=format:%h %s" --)
set(git_info "${_git_out}")
else()
# Get the commit exported by 'git archive'.
set(git_info [==[$Format:%h %s$]==])
endif()
# Extract commit information if available.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment