diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fb42a8..d7b8163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) ########### diff --git a/include/gtsam_points/config.hpp.in b/include/gtsam_points/config.hpp.in index 28bb2c3..6408464 100644 --- a/include/gtsam_points/config.hpp.in +++ b/include/gtsam_points/config.hpp.in @@ -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