Skip to content

Instantly share code, notes, and snippets.

@volviq
Created October 2, 2017 16:29
Show Gist options
  • Save volviq/37802aa3d82e007c921ef3be50fad147 to your computer and use it in GitHub Desktop.
Save volviq/37802aa3d82e007c921ef3be50fad147 to your computer and use it in GitHub Desktop.
# Get the latest commit hash of the working branch
execute_process(
COMMAND git log -1 --format="%H %s"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment