Squashed 'cmake/' content from commit 07b56b6

git-subtree-dir: cmake
git-subtree-split: 07b56b6a3dbe9f0c15160b3d11f11702db5e3999
This commit is contained in:
Christina Sander
2022-10-20 13:45:27 +02:00
commit e42ca53cee
23 changed files with 1826 additions and 0 deletions

17
Modules/ProcessGIT.cmake Normal file
View File

@@ -0,0 +1,17 @@
if (GIT_FOUND)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()