Skip to content

Commit

Permalink
{cmake} Better handling of git revision in REVISION_ID
Browse files Browse the repository at this point in the history
Only add it if it exits & indicate that it is git.

This also leaves the cmake version in the ID in case the git tag doesn't exist or doesn't contain it.
  • Loading branch information
asmaloney committed Jun 22, 2024
1 parent 7bebe54 commit 9a2a327
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ option( E57_RELEASE_LTO "Compile release library with link-time optimization" ON

#########################################################################################

set( REVISION_ID "${PROJECT_NAME}-${GIT_LATEST_TAG}-${${PROJECT_NAME}_BUILD_TAG}" )
set( REVISION_ID "${PROJECT_NAME}-${PROJECT_VERSION}-${${PROJECT_NAME}_BUILD_TAG}" )
if ( GIT_LATEST_TAG )
set( REVISION_ID "${REVISION_ID} (git ${GIT_LATEST_TAG})" )
endif()
message( STATUS "[${PROJECT_NAME}] Revision ID: ${REVISION_ID}" )

# Target
Expand Down

0 comments on commit 9a2a327

Please sign in to comment.