Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
cc02515d
Commit
cc02515d
authored
6 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Get version from git tags and commit
parent
801d48d4
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-4
1 addition, 4 deletions
CMakeLists.txt
cmake/git_version.cmake
+31
-0
31 additions, 0 deletions
cmake/git_version.cmake
cv-node/include/ftl/config.h.in
+2
-0
2 additions, 0 deletions
cv-node/include/ftl/config.h.in
with
34 additions
and
4 deletions
CMakeLists.txt
+
1
−
4
View file @
cc02515d
...
...
@@ -27,10 +27,7 @@ add_definitions(-DHAVE_CUDA)
include_directories
(
${
CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
}
)
endif
(
CUDA_FOUND
)
set
(
ftl_VERSION_MAJOR
"1"
)
set
(
ftl_VERSION_MINOR
"0"
)
set
(
ftl_VERSION_PATCH
"0"
)
set
(
FTL_VERSION
"
\"
${
ftl_VERSION_MAJOR
}
.
${
ftl_VERSION_MINOR
}
.
${
ftl_VERSION_PATCH
}
\"
"
)
include
(
git_version
)
if
(
WIN32
)
file
(
TO_CMAKE_PATH
"$ENV{USERPROFILE}"
ENV_USERPROFILE
)
...
...
This diff is collapsed.
Click to expand it.
cmake/git_version.cmake
0 → 100644
+
31
−
0
View file @
cc02515d
find_package
(
Git QUIET REQUIRED
)
if
(
Git_FOUND
)
#CHECK_REQUIRED_VARIABLE(GIT_EXECUTABLE)
execute_process
(
COMMAND
"
${
GIT_EXECUTABLE
}
"
describe --contains HEAD
WORKING_DIRECTORY
"
${
PROJECT_SOURCE_DIR
}
"
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string
(
REGEX REPLACE
"^v([0-9]+)
\\
..*"
"
\\
1"
ftl_VERSION_MAJOR
"
${
VERSION
}
"
)
string
(
REGEX REPLACE
"^v[0-9]+
\\
.([0-9]+).*"
"
\\
1"
ftl_VERSION_MINOR
"
${
VERSION
}
"
)
string
(
REGEX REPLACE
"^v[0-9]+
\\
.[0-9]+
\\
.([0-9]+).*"
"
\\
1"
ftl_VERSION_PATCH
"
${
VERSION
}
"
)
string
(
REGEX REPLACE
"^v[0-9]+
\\
.[0-9]+
\\
.[0-9]+(.*)"
"
\\
1"
ftl_VERSION_SHA1
"
${
VERSION
}
"
)
set
(
FTL_VERSION
"
\"
${
ftl_VERSION_MAJOR
}
.
${
ftl_VERSION_MINOR
}
.
${
ftl_VERSION_PATCH
}
\"
"
)
else
()
set
(
ftl_VERSION_MAJOR
"0"
)
set
(
ftl_VERSION_MINOR
"0"
)
set
(
ftl_VERSION_PATCH
"0"
)
set
(
FTL_VERSION
"
\"
${
ftl_VERSION_MAJOR
}
.
${
ftl_VERSION_MINOR
}
.
${
ftl_VERSION_PATCH
}
\"
"
)
message
(
WARNING
"Version could not be obtained from git"
)
endif
()
This diff is collapsed.
Click to expand it.
cv-node/include/ftl/config.h.in
+
2
−
0
View file @
cc02515d
...
...
@@ -4,10 +4,12 @@
#cmakedefine HAVE_VIZ
#cmakedefine HAVE_OPENCVCUDA
#define FTL_VERSION_LONG "@VERSION@"
#define FTL_VERSION @FTL_VERSION@
#define FTL_VERSION_MAJOR @ftl_VERSION_MAJOR@
#define FTL_VERSION_MINOR @ftl_VERSION_MINOR@
#define FTL_VERSION_PATCH @ftl_VERSION_PATCH@
#define FTL_VERSION_SHA1 "@ftl_VERSION_SHA1@"
#define FTL_CONFIG_ROOT @FTL_CONFIG_ROOT@
#define FTL_CACHE_ROOT @FTL_CACHE_ROOT@
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment