add capture of git revision into VERSION.sha

Signed-off-by: Karl W. Schulz <karl.schulz@amd.com>


[ROCm/rocprofiler-compute commit: 0d314be72d]
Este commit está contenido en:
Karl W. Schulz
2022-11-11 06:44:40 -06:00
cometido por Karl W. Schulz
padre a801e93bd3
commit bc2023c632
Se han modificado 3 ficheros con 17 adiciones y 0 borrados
+1
Ver fichero
@@ -14,6 +14,7 @@ __pycache__
.coverage
saved_analysis
pmc_kernel_top.csv
VERSION.sha
# temp files
/tests/Testing
+15
Ver fichero
@@ -33,6 +33,17 @@ project(
include(ExternalProject)
include(GNUInstallDirs)
# version control info
find_package(Git)
if(Git_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
execute_process(
COMMAND git log --pretty=format:%h -n 1
OUTPUT_VARIABLE OMNIPERF_GIT_REV
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
endif()
message(STATUS "Git revision: ${GIT_REV}")
set(CMAKE_BUILD_TYPE "Release")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX
@@ -151,6 +162,10 @@ if(LOCALHOST MATCHES "TheraS01|.*\.thera\.amd\.com|thera-hn")
list(POP_BACK CMAKE_MESSAGE_INDENT)
endif()
# git versioning file
configure_file(${PROJECT_SOURCE_DIR}/cmake/VERSION.sha.in
${PROJECT_SOURCE_DIR}/VERSION.sha @ONLY)
enable_testing()
add_test(
@@ -0,0 +1 @@
@OMNIPERF_GIT_REV@