Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
87ab54ad
Commit
87ab54ad
authored
Oct 19, 2015
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #156 from Zbyl/fix-getgitversion
Fix get_git_version to use GIT_EXECUTABLE.
parents
559c71d8
cd2e633f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
AUTHORS
AUTHORS
+1
-0
CONTRIBUTORS
CONTRIBUTORS
+1
-0
GetGitVersion.cmake
cmake/GetGitVersion.cmake
+13
-13
No files found.
AUTHORS
View file @
87ab54ad
...
@@ -25,3 +25,4 @@ Paul Redmond <paul.redmond@gmail.com>
...
@@ -25,3 +25,4 @@ Paul Redmond <paul.redmond@gmail.com>
Shuo Chen <chenshuo@chenshuo.com>
Shuo Chen <chenshuo@chenshuo.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Dirac Research
Dirac Research
Zbigniew Skowron <zbychs@gmail.com>
CONTRIBUTORS
View file @
87ab54ad
...
@@ -41,3 +41,4 @@ Pierre Phaneuf <pphaneuf@google.com>
...
@@ -41,3 +41,4 @@ Pierre Phaneuf <pphaneuf@google.com>
Shuo Chen <chenshuo@chenshuo.com>
Shuo Chen <chenshuo@chenshuo.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Tobias Ulvgård <tobias.ulvgard@dirac.se>
Tobias Ulvgård <tobias.ulvgard@dirac.se>
Zbigniew Skowron <zbychs@gmail.com>
cmake/GetGitVersion.cmake
View file @
87ab54ad
...
@@ -20,7 +20,7 @@ set(__get_git_version INCLUDED)
...
@@ -20,7 +20,7 @@ set(__get_git_version INCLUDED)
function
(
get_git_version var
)
function
(
get_git_version var
)
if
(
GIT_EXECUTABLE
)
if
(
GIT_EXECUTABLE
)
execute_process
(
COMMAND
git
describe --match
"v[0-9]*.[0-9]*.[0-9]*"
--abbrev=8
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
describe --match
"v[0-9]*.[0-9]*.[0-9]*"
--abbrev=8
RESULT_VARIABLE status
RESULT_VARIABLE status
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_VARIABLE GIT_VERSION
ERROR_QUIET
)
ERROR_QUIET
)
...
@@ -30,22 +30,22 @@ function(get_git_version var)
...
@@ -30,22 +30,22 @@ function(get_git_version var)
string
(
STRIP
${
GIT_VERSION
}
GIT_VERSION
)
string
(
STRIP
${
GIT_VERSION
}
GIT_VERSION
)
string
(
REGEX REPLACE
"-[0-9]+-g"
"-"
GIT_VERSION
${
GIT_VERSION
}
)
string
(
REGEX REPLACE
"-[0-9]+-g"
"-"
GIT_VERSION
${
GIT_VERSION
}
)
endif
()
endif
()
# Work out if the repository is dirty
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
update-index -q --refresh
OUTPUT_QUIET
ERROR_QUIET
)
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
diff-index --name-only HEAD --
OUTPUT_VARIABLE GIT_DIFF_INDEX
ERROR_QUIET
)
string
(
COMPARE NOTEQUAL
"
${
GIT_DIFF_INDEX
}
"
""
GIT_DIRTY
)
if
(
${
GIT_DIRTY
}
)
set
(
GIT_VERSION
"
${
GIT_VERSION
}
-dirty"
)
endif
()
else
()
else
()
set
(
GIT_VERSION
"v0.0.0"
)
set
(
GIT_VERSION
"v0.0.0"
)
endif
()
endif
()
# Work out if the repository is dirty
execute_process
(
COMMAND git update-index -q --refresh
OUTPUT_QUIET
ERROR_QUIET
)
execute_process
(
COMMAND git diff-index --name-only HEAD --
OUTPUT_VARIABLE GIT_DIFF_INDEX
ERROR_QUIET
)
string
(
COMPARE NOTEQUAL
"
${
GIT_DIFF_INDEX
}
"
""
GIT_DIRTY
)
if
(
${
GIT_DIRTY
}
)
set
(
GIT_VERSION
"
${
GIT_VERSION
}
-dirty"
)
endif
()
message
(
"-- git Version:
${
GIT_VERSION
}
"
)
message
(
"-- git Version:
${
GIT_VERSION
}
"
)
set
(
${
var
}
${
GIT_VERSION
}
PARENT_SCOPE
)
set
(
${
var
}
${
GIT_VERSION
}
PARENT_SCOPE
)
endfunction
()
endfunction
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment