srsLTE/cmake/modules/SRSLTEbuildinfo.cmake.in

22 lines
526 B
CMake
Raw Normal View History

2017-11-23 04:25:40 -08:00
cmake_minimum_required(VERSION 2.6)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
2019-10-04 08:02:20 -07:00
WORKING_DIRECTORY "@PROJECT_SOURCE_DIR@"
2017-11-23 04:25:40 -08:00
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND git log -1 --format=%h
2019-10-04 08:02:20 -07:00
WORKING_DIRECTORY "@PROJECT_SOURCE_DIR@"
2017-11-23 04:25:40 -08:00
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "Generating build_info.h")
configure_file(
2019-10-04 08:02:20 -07:00
@PROJECT_SOURCE_DIR@/lib/include/srslte/build_info.h.in
2017-11-23 04:25:40 -08:00
@CMAKE_BINARY_DIR@/lib/include/srslte/build_info.h
)