Skip to content

Commit

Permalink
chore(cmake): allow user to override GIT_COMMIT from cmake.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Dec 14, 2023
1 parent 38ce00f commit 0af2f3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/modules/compute_versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ macro(compute_versions api_version_path schema_version_path)
message(STATUS "Driver schema version ${PPM_SCHEMA_CURRENT_VERSION_MAJOR}.${PPM_SCHEMA_CURRENT_VERSION_MINOR}.${PPM_SCHEMA_CURRENT_VERSION_PATCH}")

# GIT COMMIT
execute_process(COMMAND git rev-parse HEAD OUTPUT_VARIABLE GIT_COMMIT ERROR_QUIET WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(NOT DEFINED GIT_COMMIT)
execute_process(COMMAND git rev-parse HEAD OUTPUT_VARIABLE GIT_COMMIT ERROR_QUIET WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
string(STRIP "${GIT_COMMIT}" GIT_COMMIT)
endmacro()

0 comments on commit 0af2f3d

Please sign in to comment.