horizont/cmake/stamp_build_info.cmake

13 lines
429 B
CMake
Raw Normal View History

2026-08-10 15:37:10 +02:00
# Generates HorizontBuildInfo.h with the current wall-clock timestamp.
# Run at build time (not configure time) so every build stamps a fresh date.
set(output "${GENERATED_DIR}/HorizontBuildInfo.h")
execute_process(
COMMAND date "+%Y-%m-%d__%H-%M-%S"
OUTPUT_VARIABLE timestamp
OUTPUT_STRIP_TRAILING_WHITESPACE)
file(WRITE "${output}"
"#pragma once\n"
"#define HORIZONT_BUILD_TIMESTAMP \"${timestamp}\"\n")