summaryrefslogtreecommitdiffstats
path: root/cmake/Modules/version.cmake
diff options
context:
space:
mode:
authorMauro Sardara <msardara+fdio@cisco.com>2017-02-22 23:24:21 +0100
committerMauro Sardara <msardara+fdio@cisco.com>2017-02-22 23:24:21 +0100
commit975b5709addd72cba7184f94f2805f1c42e07dbe (patch)
treef89f813f04f6ba3f7558ba7bb9f07df1f9bdccef /cmake/Modules/version.cmake
parent9b30fc10fb1cbebe651e5a107e8ca5b24de54675 (diff)
First commit: http-server
Change-Id: Ia527fe3065016404b0ea752ddc9e15c96288ed86 Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
Diffstat (limited to 'cmake/Modules/version.cmake')
-rw-r--r--cmake/Modules/version.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmake/Modules/version.cmake b/cmake/Modules/version.cmake
new file mode 100644
index 00000000..44a41099
--- /dev/null
+++ b/cmake/Modules/version.cmake
@@ -0,0 +1,15 @@
+#
+# Get a version to pass on the command line
+#
+execute_process(COMMAND ${PROJECT_SOURCE_DIR}/cmake/get_version.sh ${PROJECT_SOURCE_DIR}
+ OUTPUT_VARIABLE RELEASE_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+execute_process(COMMAND date -u +%Y-%m-%dT%H:%M:%SZ
+ OUTPUT_VARIABLE ISO_DATE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+MESSAGE(STATUS "Configuring version ${RELEASE_VERSION}")
+
+add_definitions("-DRELEASE_VERSION=\"${RELEASE_VERSION}\"")
+