Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
code
pugs
Commits
051b3a1d
Commit
051b3a1d
authored
7 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Fixed git revision infos
parent
8cd08950
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+0
-1
0 additions, 1 deletion
CMakeLists.txt
utils/CMakeLists.txt
+18
-4
18 additions, 4 deletions
utils/CMakeLists.txt
utils/RevisionInfo.cpp
+4
-8
4 additions, 8 deletions
utils/RevisionInfo.cpp
utils/pastis_git_revision.hpp.in
+8
-7
8 additions, 7 deletions
utils/pastis_git_revision.hpp.in
with
30 additions
and
20 deletions
CMakeLists.txt
+
0
−
1
View file @
051b3a1d
...
@@ -22,7 +22,6 @@ include_directories(${CMAKE_SOURCE_DIR}/packages/CLI11/include)
...
@@ -22,7 +22,6 @@ include_directories(${CMAKE_SOURCE_DIR}/packages/CLI11/include)
add_subdirectory
(
${
CMAKE_SOURCE_DIR
}
/packages/kokkos
)
add_subdirectory
(
${
CMAKE_SOURCE_DIR
}
/packages/kokkos
)
include_directories
(
${
Kokkos_INCLUDE_DIRS_RET
}
)
include_directories
(
${
Kokkos_INCLUDE_DIRS_RET
}
)
# Pastis utils
# Pastis utils
add_subdirectory
(
utils
)
add_subdirectory
(
utils
)
include_directories
(
utils
)
include_directories
(
utils
)
...
...
This diff is collapsed.
Click to expand it.
utils/CMakeLists.txt
+
18
−
4
View file @
051b3a1d
...
@@ -8,14 +8,28 @@ git_describe(PASTIS_VERSION "--abbrev=0")
...
@@ -8,14 +8,28 @@ git_describe(PASTIS_VERSION "--abbrev=0")
get_git_head_revision
(
PASTIS_HEAD PASTIS_HASH
)
get_git_head_revision
(
PASTIS_HEAD PASTIS_HASH
)
git_local_changes
(
PASTIS_HAS_LOCAL_CHANGES
)
git_local_changes
(
PASTIS_HAS_LOCAL_CHANGES
)
set
(
PASTIS_IS_CLEAN
${
PASTIS_HAS_LOCAL_CHANGES
}
STREQ
"CLEAN"
)
if
(
${
PASTIS_HAS_LOCAL_CHANGES
}
STREQUAL
"CLEAN"
)
set
(
PASTIS_IS_CLEAN true
)
else
()
set
(
PASTIS_IS_CLEAN false
)
endif
()
add_custom_target
(
git_revision ALL DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/pastis_git_revision.hpp
)
add_custom_target
(
set_source_files_properties
(
${
CMAKE_CURRENT_BINARY_DIR
}
/pastis_git_revision.hpp PROPERTIES GENERATED TRUE HEADER_FILE_ONLY TRUE
)
git_revision
ALL
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/pastis_git_revision.hpp
)
set_source_files_properties
(
${
CMAKE_CURRENT_BINARY_DIR
}
/pastis_git_revision.hpp
PROPERTIES
GENERATED TRUE
HEADER_FILE_ONLY TRUE
)
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/pastis_git_revision.hpp.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pastis_git_revision.hpp"
@ONLY
)
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/pastis_git_revision.hpp.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pastis_git_revision.hpp"
@ONLY
)
list
(
APPEND SOURCES pastis_git_revision.hpp
)
list
(
APPEND SOURCES
${
CMAKE_CURRENT_BINARY_DIR
}
/
pastis_git_revision.hpp
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_library
(
PastisUtils RevisionInfo.cpp
)
add_library
(
PastisUtils RevisionInfo.cpp
)
add_dependencies
(
PastisUtils git_revision
)
This diff is collapsed.
Click to expand it.
utils/RevisionInfo.cpp
+
4
−
8
View file @
051b3a1d
...
@@ -3,24 +3,20 @@
...
@@ -3,24 +3,20 @@
std
::
string
RevisionInfo
::
version
()
std
::
string
RevisionInfo
::
version
()
{
{
return
PASTIS_VERSION
;
return
PASTIS_
GIT_
VERSION
;
}
}
std
::
string
RevisionInfo
::
head
()
std
::
string
RevisionInfo
::
head
()
{
{
return
PASTIS_HEAD
;
return
PASTIS_
GIT_
HEAD
;
}
}
std
::
string
RevisionInfo
::
hash
()
std
::
string
RevisionInfo
::
hash
()
{
{
return
PASTIS_HASH
;
return
PASTIS_
GIT_
HASH
;
}
}
bool
RevisionInfo
::
isClean
()
bool
RevisionInfo
::
isClean
()
{
{
#if PASTIS_IS_CLEAN
return
PASTIS_GIT_IS_CLEAN
;
return
true
;
#else
return
false
;
#endif
}
}
This diff is collapsed.
Click to expand it.
utils/pastis_git_revision.hpp.in
+
8
−
7
View file @
051b3a1d
#ifndef GIT_REVISION_HPP
#ifndef
PASTIS_
GIT_REVISION_HPP
#define GIT_REVISION_HPP
#define
PASTIS_
GIT_REVISION_HPP
#define PASTIS_VERSION "@PASTIS_VERSION@"
#define PASTIS_GIT_VERSION "@PASTIS_VERSION@"
#define PASTIS_HEAD "@PASTIS_HEAD@"
#define PASTIS_GIT_HEAD "@PASTIS_HEAD@"
#define PASTIS_HASH "@PASTIS_HASH@"
#define PASTIS_GIT_HASH "@PASTIS_HASH@"
#define PASTIS_HAS_LOCAL_CHANGES "@PASTIS_HAS_LOCAL_CHANGES@"
#define PASTIS_GIT_HAS_LOCAL_CHANGES "@PASTIS_HAS_LOCAL_CHANGES@"
#define PASTIS_GIT_IS_CLEAN @PASTIS_IS_CLEAN@
#endif // GIT_REVISION_HPP
#endif //
PASTIS_
GIT_REVISION_HPP
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