This is an automated email from the ASF dual-hosted git repository.

petasis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git


The following commit(s) were added to refs/heads/master by this push:
     new a72ee4f  Infer Rivet version from file VERSION
a72ee4f is described below

commit a72ee4fc8fbc9e61a8eda121812f9d8f70390882
Author: petasis <petas...@yahoo.gr>
AuthorDate: Sat Dec 15 23:28:39 2018 +0200

    Infer Rivet version from file VERSION
---
 cmake/CMakeLists.txt | 20 +++++++++-----------
 cmake/README.cmake   |  6 +++---
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 101d367..fc60204 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -5,19 +5,17 @@
 cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
 
 # Rivet version:
-
-# in order to avoid chasing around multiple definition of the module version 
we infer
+# 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_TOP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." )
+# Read the file named VERSION from the top Rivet directory...
+FILE ( READ "${RIVET_TOP_DIR}/VERSION" RIVET_VERSION_FROM_FILE )
+STRING ( REGEX MATCH "([0-9]+)\.([0-9]+)\.([0-9]+)" _ 
${RIVET_VERSION_FROM_FILE} )
+SET ( RIVET_MAJOR_VERSION ${CMAKE_MATCH_1} )
+SET ( RIVET_MINOR_VERSION ${CMAKE_MATCH_2} )
+SET ( RIVET_PATCH_VERSION ${CMAKE_MATCH_3} )
+MESSAGE ( STATUS "Rivet version: 
${RIVET_MAJOR_VERSION}.${RIVET_MINOR_VERSION}.${RIVET_PATCH_VERSION}" )
 
 set(RIVET_VERSION
   ${RIVET_MAJOR_VERSION}.${RIVET_MINOR_VERSION}.${RIVET_PATCH_VERSION})
diff --git a/cmake/README.cmake b/cmake/README.cmake
index 087537e..9d283f1 100644
--- a/cmake/README.cmake
+++ b/cmake/README.cmake
@@ -28,13 +28,13 @@ Compiling Rivet with cmake:
    in a known location (i.e. under Windows), you can speficy APACHE_ROOT:
 
    cmake -E make_directory build
-   cmake -E chdir build cmake -DAPACHE_ROOT=G:/Apache24 ..
+   cmake -E chdir build cmake -DAPACHE_ROOT=F:/Apache24 ..
    cmake --build build --config Release --target install
 
 5) Compile for 64 bits under Windows (for Visual Studio 2017):
 
    cmake -E make_directory build_64
-   cmake -E chdir build_64 cmake -DAPACHE_ROOT=G:/Apache24 -G "Visual Studio 
15 2017 Win64" ..
+   cmake -E chdir build_64 cmake -DAPACHE_ROOT=F:/Apache24_64 -G "Visual 
Studio 15 2017 Win64" ..
    cmake --build build_64 --config Release --target install
 
    -G "..." can be set to any of the available 64-bit generators available 
under
@@ -43,7 +43,7 @@ Compiling Rivet with cmake:
 6) Specify Tcl at a non standard location:
 
    cmake -E make_directory build_64
-   cmake -E chdir build_64 cmake -DAPACHE_ROOT=G:/Apache24 -G "Visual Studio 
15 2017 Win64" -Dwith-tcl=C:/TclApps/Tcl64/lib ..
+   cmake -E chdir build_64 cmake -DAPACHE_ROOT=F:/Apache24 -G "Visual Studio 
15 2017 Win64" -Dwith-tcl=C:/TclApps/Tcl64/lib ..
    cmake --build build_64 --config Release --target install
 
    Instead of -Dwith-tcl=, -DTCL_ROOT=, -DTclStub_ROOT, and -DTCL_TCLSH= can be


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@tcl.apache.org
For additional commands, e-mail: commits-h...@tcl.apache.org

Reply via email to