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
9b84ead0
Commit
9b84ead0
authored
Oct 12, 2015
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #148 from DiracResearch/cmake-git-fix
Fixes #144 CMake fails without Git
parents
90e7cf00
c06da04b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
AUTHORS
AUTHORS
+1
-0
CONTRIBUTORS
CONTRIBUTORS
+1
-0
GetGitVersion.cmake
cmake/GetGitVersion.cmake
+15
-9
No files found.
AUTHORS
View file @
9b84ead0
...
@@ -24,3 +24,4 @@ Oleksandr Sochka <sasha.sochka@gmail.com>
...
@@ -24,3 +24,4 @@ Oleksandr Sochka <sasha.sochka@gmail.com>
Paul Redmond <paul.redmond@gmail.com>
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
CONTRIBUTORS
View file @
9b84ead0
...
@@ -40,3 +40,4 @@ Paul Redmond <paul.redmond@gmail.com>
...
@@ -40,3 +40,4 @@ Paul Redmond <paul.redmond@gmail.com>
Pierre Phaneuf <pphaneuf@google.com>
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>
cmake/GetGitVersion.cmake
View file @
9b84ead0
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
# include(GetGitVersion)
# include(GetGitVersion)
# get_git_version(GIT_VERSION)
# get_git_version(GIT_VERSION)
#
#
# Requires CMake 2.6+
# Requires CMake 2.8.11+
find_package
(
Git
)
if
(
__get_git_version
)
if
(
__get_git_version
)
return
()
return
()
...
@@ -18,17 +19,22 @@ endif()
...
@@ -18,17 +19,22 @@ endif()
set
(
__get_git_version INCLUDED
)
set
(
__get_git_version INCLUDED
)
function
(
get_git_version var
)
function
(
get_git_version var
)
execute_process
(
COMMAND git describe --match
"v[0-9]*.[0-9]*.[0-9]*"
--abbrev=8
if
(
GIT_EXECUTABLE
)
RESULT_VARIABLE status
execute_process
(
COMMAND git describe --match
"v[0-9]*.[0-9]*.[0-9]*"
--abbrev=8
OUTPUT_VARIABLE GIT_VERSION
RESULT_VARIABLE status
ERROR_QUIET
)
OUTPUT_VARIABLE GIT_VERSION
if
(
${
status
}
)
ERROR_QUIET
)
set
(
GIT_VERSION
"v0.0.0"
)
if
(
${
status
}
)
set
(
GIT_VERSION
"v0.0.0"
)
else
()
string
(
STRIP
${
GIT_VERSION
}
GIT_VERSION
)
string
(
REGEX REPLACE
"-[0-9]+-g"
"-"
GIT_VERSION
${
GIT_VERSION
}
)
endif
()
else
()
else
()
string
(
STRIP
${
GIT_VERSION
}
GIT_VERSION
)
set
(
GIT_VERSION
"v0.0.0"
)
string
(
REGEX REPLACE
"-[0-9]+-g"
"-"
GIT_VERSION
${
GIT_VERSION
}
)
endif
()
endif
()
# Work out if the repository is dirty
# Work out if the repository is dirty
execute_process
(
COMMAND git update-index -q --refresh
execute_process
(
COMMAND git update-index -q --refresh
OUTPUT_QUIET
OUTPUT_QUIET
...
...
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