Print

Print


Commit in SimDist on MAIN
configure[binary]1.121 -> 1.122
build/util.m4+51-111.29 -> 1.30
+51-11
2 modified files
check for cmake version of 2.8.2 or greater

SimDist/build
util.m4 1.29 -> 1.30
diff -u -r1.29 -r1.30
--- util.m4	18 Jul 2012 22:20:51 -0000	1.29
+++ util.m4	19 Feb 2013 22:17:50 -0000	1.30
@@ -88,12 +88,14 @@
 
 ])
 
+dnl /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
+dnl Check for cmake and its required version.
+dnl /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 AC_DEFUN(AC_PROG_CMAKE, [
 
 dnl cmake
 AC_CHECK_PROG(have_cmake, cmake, yes, no)
 
-dnl Optional component so no error message here.
 if test $have_cmake == "yes"
 then 
   CMAKE=cmake
@@ -102,6 +104,44 @@
   AC_MSG_ERROR(cmake was not found on this system)
 fi
 
+AC_MSG_CHECKING(cmake version)
+
+# Get the major, minor and patch versions from the cmake version string.
+_cmake_version=$(${CMAKE} -version | grep -o "[[0-9]]*")
+_cmake_major_version=
+_cmake_minor_version=
+_cmake_patch_version=
+i=$(expr 0)
+for n in ${_cmake_version}; do
+  if [[ "$i" == "0" ]]; then
+    _cmake_major_version=$n
+  elif [[ "$i" == "1" ]]; then
+    _cmake_minor_version=$n
+  elif [[ "$i" == "2" ]]; then
+    _cmake_patch_version=$n
+  fi
+  i=$(expr $i + 1)
+done
+
+AC_MSG_RESULT(${_cmake_major_version}.${_cmake_minor_version}.${_cmake_patch_version})
+
+dnl
+dnl Check that cmake version is 2.8.2 or greater by sequentially looking at major, minor and patch versions.
+dnl 
+
+err_msg="cmake version must be >= 2.8.2"
+
+dnl Check for major release of 2 or greater.
+if [[ "${_cmake_major_version}" -lt "2" ]]; then
+  AC_MSG_ERROR($err_msg)
+dnl Check for minor release of 8 or greater.
+elif [[ "${_cmake_minor_version}" -lt "8" ]]; then
+  AC_MSG_ERROR($err_msg)
+dnl Check for patch version of 2 or greater.
+elif [[ "${_cmake_patch_version}" -lt "2" ]]; then
+  AC_MSG_ERROR($err_msg)
+fi
+
 ])
 
 AC_DEFUN(AC_PROG_JAVA, [
@@ -165,19 +205,19 @@
 
 ])
 
-AC_DEFUN(AC_PROG_HAVE_CMAKE, [
+dnl AC_DEFUN(AC_PROG_HAVE_CMAKE, [
 
-AC_CHECK_PROG(have_cmake, cmake, yes, no)
+dnl AC_CHECK_PROG(have_cmake, cmake, yes, no)
 
-if test $have_cmake == "no"
-then
-  AC_MSG_ERROR(cmake not found)
-else
-  CMAKE=cmake
-  AC_SUBST(CMAKE) 
-fi
+dnl if test $have_cmake == "no"
+dnl then
+dnl  AC_MSG_ERROR(cmake not found)
+dnl else
+dnl  CMAKE=cmake
+dnl  AC_SUBST(CMAKE) 
+dnl fi
 
-])
+dnl ])
 
 dnl /\/\/\/\/\/\/\/\/\/\/\/\/\/\
 dnl Macro to check for svn tool.
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1