Skip to content

Commit

Permalink
CMake build out of source
Browse files Browse the repository at this point in the history
  • Loading branch information
trasherdk committed Oct 26, 2019
1 parent 3b0a43a commit 7bca3e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/GitVersion.cmake
Expand Up @@ -32,6 +32,7 @@

function (get_version_tag_from_git GIT)
execute_process(COMMAND "${GIT}" rev-parse --short=9 HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE RET
OUTPUT_VARIABLE COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand All @@ -47,7 +48,11 @@ function (get_version_tag_from_git GIT)
message(STATUS "You are currently on commit ${COMMIT}")

# Get all the tags
execute_process(COMMAND "${GIT}" rev-list --tags --max-count=1 --abbrev-commit RESULT_VARIABLE RET OUTPUT_VARIABLE TAGGEDCOMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND "${GIT}" rev-list --tags --max-count=1 --abbrev-commit
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE RET
OUTPUT_VARIABLE TAGGEDCOMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE)

if(NOT TAGGEDCOMMIT)
message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.")
Expand Down

0 comments on commit 7bca3e0

Please sign in to comment.