hyperion.ng/cmake/FindGitVersion.cmake
redpanther 49e867f5fc add an auto generated version id
Former-commit-id: df3ad6b08e24e73d957611e8be45e7e8cc717b8c
2016-03-10 06:53:21 +01:00

10 lines
494 B
CMake

execute_process( COMMAND git log -1 --format=%cn-%t/%h-%ct WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE BUILD_ID ERROR_QUIET )
execute_process( COMMAND sh -c "git branch | grep '^*' | sed 's;^*;;g' " WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE VERSION_ID ERROR_QUIET )
STRING ( STRIP "${BUILD_ID}" BUILD_ID )
STRING ( STRIP "${VERSION_ID}" VERSION_ID )
SET ( HYPERION_VERSION_ID "${VERSION_ID} (${BUILD_ID}" )
message ( STATUS "Current Version: ${HYPERION_VERSION_ID})" )