You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2018/12/03 17:08:11 UTC
[tcl-rivet] 01/02: Now we infer the version number from VERSION
This is an automated email from the ASF dual-hosted git repository.
mxmanghi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit 0978894b5804fbe16d6de2a26d51656e908013d2
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Mon Dec 3 15:49:12 2018 +0100
Now we infer the version number from VERSION
---
cmake/CMakeLists.txt | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 275ca94..101d367 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -5,9 +5,20 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
# Rivet version:
-set(RIVET_MAJOR_VERSION 3)
-set(RIVET_MINOR_VERSION 0)
-set(RIVET_PATCH_VERSION 0)
+
+# in order to avoid chasing around multiple definition of the module version we infer
+# this information from the file VERSION, which must stay in the project root directory
+# and assuming we are working from a direct child directory
+
+execute_process(COMMAND pwd)
+execute_process(COMMAND cut -s --fields=1 --delimiter='.' '../../VERSION' OUTPUT_VARIABLE RIVET_MAJOR_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process(COMMAND cut -s --fields=2 --delimiter='.' '../../VERSION' OUTPUT_VARIABLE RIVET_MINOR_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process(COMMAND cut -s --fields=3 --delimiter='.' '../../VERSION' OUTPUT_VARIABLE RIVET_PATCH_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+#set(RIVET_MAJOR_VERSION 3)
+#set(RIVET_MINOR_VERSION 2)
+#set(RIVET_PATCH_VERSION 0)
+
set(RIVET_VERSION
${RIVET_MAJOR_VERSION}.${RIVET_MINOR_VERSION}.${RIVET_PATCH_VERSION})
set(INIT_VERSION ${RIVET_MAJOR_VERSION}.${RIVET_MINOR_VERSION})
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org