summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-28 16:59:42 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-28 16:59:42 +0100
commit095ca93d81cfae0fcb137919231810577c556404 (patch)
treea5ee059d61dd5c0483657105fb2f5400350f3150 /CMakeLists.txt
parent5f6177e00fe4c56ece2cabdd61b772ed040c6e19 (diff)
downloadfastd-095ca93d81cfae0fcb137919231810577c556404.tar
fastd-095ca93d81cfae0fcb137919231810577c556404.zip
Organize method and protocol source files into distinct source directories
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4490bc7..910ba33 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -145,4 +145,15 @@ string(COMPARE NOTEQUAL "${SIZEOF_ETHHDR}" "" HAVE_ETHHDR)
configure_file(${FASTD_SOURCE_DIR}/config.h.in ${FASTD_BINARY_DIR}/config.h)
+add_custom_target(
+ version
+ COMMAND echo "#ifndef _FASTD_VERSION_H_" > ${FASTD_BINARY_DIR}/version.h.new
+ COMMAND echo "#define _FASTD_VERSION_H_" >> ${FASTD_BINARY_DIR}/version.h.new
+ COMMAND sh -c "echo \"#define FASTD_VERSION \\\"$(git --git-dir=./.git describe --dirty 2>/dev/null || echo ${FASTD_VERSION})\\\"\"" >> ${FASTD_BINARY_DIR}/version.h.new
+ COMMAND echo "#endif /* _FASTD_VERSION_H_ */" >> ${FASTD_BINARY_DIR}/version.h.new
+ COMMAND cmp -s ${FASTD_BINARY_DIR}/version.h.new ${FASTD_BINARY_DIR}/version.h && rm ${FASTD_BINARY_DIR}/version.h.new || mv ${FASTD_BINARY_DIR}/version.h.new ${FASTD_BINARY_DIR}/version.h
+ WORKING_DIRECTORY "${FASTD_SOURCE_DIR}"
+ VERBATIM
+)
+
add_subdirectory(src)