Skip to content

Commit

Permalink
Merge pull request #33 from koide3/hash
Browse files Browse the repository at this point in the history
embed git commit id
  • Loading branch information
koide3 authored Nov 6, 2024
2 parents 14259b3 + 1d562b5 commit f45e339
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ if(ENABLE_COVERAGE)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()

execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE GTSAM_POINTS_GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "GTSAM_POINTS_GIT_HASH=${GTSAM_POINTS_GIT_HASH}")

configure_file(include/gtsam_points/config.hpp.in include/gtsam_points/config.hpp)

###########
Expand Down
2 changes: 2 additions & 0 deletions include/gtsam_points/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#define GTSAM_POINTS_VERSION_PATCH @CMAKE_PROJECT_VERSION_PATCH@
#define GTSAM_POINTS_VERSION_STRING "@CMAKE_PROJECT_VERSION@"

#define GTSAM_POINTS_GIT_HASH "@GTSAM_POINTS_GIT_HASH@"

#cmakedefine GTSAM_POINTS_USE_TBB

#cmakedefine GTSAM_POINTS_USE_OPENMP
Expand Down

0 comments on commit f45e339

Please sign in to comment.