Skip to content

Commit

Permalink
Finesse fix for git.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodr committed Oct 21, 2019
1 parent f519379 commit 51ebdc2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmake/custom/git.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
set(GIT_REVISION "undefined")
find_package(Git)

find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-list --abbrev-commit --max-count=1 HEAD
OUTPUT_VARIABLE _git_revision
ERROR_QUIET
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
string(STRIP ${_git_revision} _git_revision)
if(_git_revision)
set(GIT_REVISION ${_git_revision})
string(STRIP ${_git_revision} GIT_REVISION)
endif()
endif()

0 comments on commit 51ebdc2

Please sign in to comment.