Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ArborX hash to "hash-dirty" if worktree is not clean #558

Merged
merged 2 commits into from
Oct 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Change CMake commands to lower case for consistency
  • Loading branch information
aprokop committed Oct 20, 2021
commit 4c2ae155950b92cfb97f055f6e0c5d955d19a403
24 changes: 12 additions & 12 deletions cmake/SetupVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
# is called by through a target created by add_custom_target so that it is
# always considered to be out-of-date.

SET(ARBORX_GIT_COMMIT_HASH "No hash available")
set(ARBORX_GIT_COMMIT_HASH "No hash available")

IF(EXISTS ${SOURCE_DIR}/.git)
FIND_PACKAGE(Git QUIET)
IF(GIT_FOUND)
EXECUTE_PROCESS(
if(EXISTS ${SOURCE_DIR}/.git)
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --verify --short HEAD
OUTPUT_VARIABLE ARBORX_GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(
execute_process(
COMMAND ${GIT_EXECUTABLE} status --porcelain --untracked-files=no
OUTPUT_VARIABLE ARBORX_GIT_WORKTREE_STATUS)
IF(ARBORX_GIT_WORKTREE_STATUS)
SET(ARBORX_GIT_COMMIT_HASH "${ARBORX_GIT_COMMIT_HASH}-dirty")
ENDIF()
ENDIF()
ENDIF()
MESSAGE(STATUS "ArborX hash = '${ARBORX_GIT_COMMIT_HASH}'")
if(ARBORX_GIT_WORKTREE_STATUS)
set(ARBORX_GIT_COMMIT_HASH "${ARBORX_GIT_COMMIT_HASH}-dirty")
endif()
endif()
endif()
message(STATUS "ArborX hash = '${ARBORX_GIT_COMMIT_HASH}'")

configure_file(${SOURCE_DIR}/src/ArborX_Version.hpp.in
${BINARY_DIR}/include/ArborX_Version.hpp)