summaryrefslogtreecommitdiffstats
path: root/cmake/generate_version.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/generate_version.cmake')
-rw-r--r--cmake/generate_version.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/generate_version.cmake b/cmake/generate_version.cmake
index 3830800..104e49c 100644
--- a/cmake/generate_version.cmake
+++ b/cmake/generate_version.cmake
@@ -1,7 +1,8 @@
-set(VERSION_FILE "${FASTD_BINARY_DIR}/src/fastd_version.h")
+set(VERSION_FILE "${FASTD_BINARY_DIR}/gen/generated/version.h")
add_custom_target(
version
+ COMMAND mkdir -p "${FASTD_BINARY_DIR}/gen/generated"
COMMAND echo "#pragma once" > "${VERSION_FILE}.new"
COMMAND sh -c "echo \"#define FASTD_VERSION \\\"$(git --git-dir=./.git describe --dirty 2>/dev/null || echo ${FASTD_VERSION})\\\"\"" >> "${VERSION_FILE}.new"
COMMAND cmp -s "${VERSION_FILE}" "${VERSION_FILE}.new" && rm "${VERSION_FILE}.new" || mv "${VERSION_FILE}.new" "${VERSION_FILE}"