Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csg-eb
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
exa
csg-eb
Commits
52f2779a
Commit
52f2779a
authored
1 year ago
by
Deepak Rangarajan
Browse files
Options
Downloads
Patches
Plain Diff
add git hash as a property
parent
423c8d16
Branches
main
No related tags found
1 merge request
!125
add git hash as a property
Pipeline
#35197
passed
1 year ago
Stage: build-img
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+21
-0
21 additions, 0 deletions
CMakeLists.txt
GNUmakefile
+6
-1
6 additions, 1 deletion
GNUmakefile
with
27 additions
and
1 deletion
CMakeLists.txt
+
21
−
0
View file @
52f2779a
...
...
@@ -60,3 +60,24 @@ install(EXPORT CsgEbConfig
if
(
CSG_CGAL_ENABLED
)
target_compile_definitions
(
csg-eb PUBLIC USE_CGAL
)
endif
()
set
(
CSGEB_GIT_HASH
""
)
execute_process
(
COMMAND git describe --abbrev=12 --dirty --always --tags
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
OUTPUT_VARIABLE CSGEB_GIT_HASH
ERROR_VARIABLE _tmperr
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
_tmperr
)
message
(
WARNING
"Failing to retrieve Git commit from repo:
${
PROJECT_SOURCE_DIR
}
"
)
endif
()
set_target_properties
(
csg-eb PROPERTIES CSGEB_GIT_HASH
${
CSGEB_GIT_HASH
}
EXPORT_PROPERTIES CSGEB_GIT_HASH
)
# to be used by gnumake
file
(
WRITE
${
CMAKE_CURRENT_BINARY_DIR
}
/CsgEbConfig.mk
"CSGEB_GIT_HASH :=
${
CSGEB_GIT_HASH
}
"
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/CsgEbConfig.mk
DESTINATION
"
${
CMAKE_INSTALL_PREFIX
}
"
)
This diff is collapsed.
Click to expand it.
GNUmakefile
+
6
−
1
View file @
52f2779a
...
...
@@ -8,6 +8,7 @@
TARGET
?=
libcsg-eb.a
BUILD_DIR
?=
./build
CONFIG_FILE
?=
CsgEbConfig.mk
SRCFILENAMES
:=
csg.cpp
\
levelset_2d.cpp
\
...
...
@@ -46,11 +47,15 @@ $(BUILD_DIR)/%.cpp.o: %.cpp
$(
MKDIR_P
)
$(
dir
$@
)
$(
CXX
)
$(
CPPFLAGS
)
$(
CXXFLAGS
)
-std
=
c++17
-c
$<
-o
$@
$(CONFIG_FILE)
:
$(TARGET)
@
echo
"CSGEB_GIT_HASH :=
$(
shell git describe --abbrev=12 --dirty --always --tags
)
"
>
$@
.PHONY
:
install
install
:
$(TARGET)
install
:
$(TARGET)
$(CONFIG_FILE)
@$(
MKDIR_P
)
$(
DESTDIR
)
/lib
$(
DESTDIR
)
/include
install
-m
0755
$<
$(
DESTDIR
)
/lib
install
-m
0755 include/
*
.hpp
$(
DESTDIR
)
/include
install
-m
0755
$(
CONFIG_FILE
)
$(
DESTDIR
)
.PHONY
:
clean
clean
:
...
...
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