Skip to content
Snippets Groups Projects
Commit fe2c558b authored by Brad King's avatar Brad King
Browse files

CMakeVersion: Preserve Git information during 'git archive'

Use `export-subst` to get information about the Git commit used to
produce an archive.
parent 0505a66c
No related branches found
No related tags found
No related merge requests found
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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment