[MOAB-dev] r1201 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Thu Jul 12 17:38:46 CDT 2007


Author: kraftche
Date: 2007-07-12 17:38:46 -0500 (Thu, 12 Jul 2007)
New Revision: 1201

Added:
   MOAB/trunk/MBVersion.h.in
Modified:
   MOAB/trunk/MBCore.cpp
   MOAB/trunk/MBCore.hpp
   MOAB/trunk/configure.in
Log:
Fix MOAB version number stuff:
 o Version number specified only in one place: AC_INIT in configure.in
 o MOAB version information exported via preprocessor macros in MBVersion.h
 o MBCore::impl_version implemented using macros in MBVersion.h
 o Implement version number scheme:
     x.99       : alpha
     x.y  (y<99): beta
     x.y.z      : release
 


Modified: MOAB/trunk/MBCore.cpp
===================================================================
--- MOAB/trunk/MBCore.cpp	2007-07-12 18:18:37 UTC (rev 1200)
+++ MOAB/trunk/MBCore.cpp	2007-07-12 22:38:46 UTC (rev 1201)
@@ -24,6 +24,7 @@
 #include <vector>
 #include <string>
 #include <algorithm>
+#include "MBVersion.h"
 #include "MBCore.hpp"
 #include "TagServer.hpp"
 #include "MeshSetSequence.hpp"
@@ -275,6 +276,14 @@
   return 1;
 }
 
+float MBCore::impl_version( std::string *version_string )
+{
+  if (version_string)
+    *version_string = MB_VERSION_STRING;
+  
+  return MB_VERSION_MAJOR + MB_VERSION_MINOR / 100.0;
+}
+
 //! get the type from a handle, returns type
 MBEntityType MBCore::type_from_handle(const MBEntityHandle handle) const
 {

Modified: MOAB/trunk/MBCore.hpp
===================================================================
--- MOAB/trunk/MBCore.hpp	2007-07-12 18:18:37 UTC (rev 1200)
+++ MOAB/trunk/MBCore.hpp	2007-07-12 22:38:46 UTC (rev 1201)
@@ -16,9 +16,6 @@
 #ifndef MB_IMPL_GENERAL_HPP
 #define MB_IMPL_GENERAL_HPP
 
-#define MOAB_IMPL_VERSION 1.01F
-#define MOAB_IMPL_VERSION_STRING "1.01"
-
 #include "MBInterface.hpp"
 #include "MBProcConfig.hpp"
 #include <map>
@@ -983,11 +980,5 @@
   
 };
 
-inline float MBCore::impl_version(std::string *version_string) 
-{
-  if (NULL != version_string)
-    *version_string = std::string("MOAB IMPLEMENTATION version ") + std::string(MOAB_IMPL_VERSION_STRING);
-  return MOAB_IMPL_VERSION;
-}
   
 #endif   // MB_IMPL_GENERAL_HPP

Added: MOAB/trunk/MBVersion.h.in
===================================================================
--- MOAB/trunk/MBVersion.h.in	                        (rev 0)
+++ MOAB/trunk/MBVersion.h.in	2007-07-12 22:38:46 UTC (rev 1201)
@@ -0,0 +1,19 @@
+#ifndef MB_VERSION_H
+#define MB_VERSION_H
+
+/* MOAB Version */
+#undef MB_VERSION
+
+/* MOAB Major Version */
+#undef MB_VERSION_MAJOR
+
+/* MOAB Minor Version */
+#undef MB_VERSION_MINOR
+
+/* MOAB Patch Level */
+#undef MB_VERSION_PATCH
+
+/* MOAB Version String */
+#undef MB_VERSION_STRING
+
+#endif

Modified: MOAB/trunk/configure.in
===================================================================
--- MOAB/trunk/configure.in	2007-07-12 18:18:37 UTC (rev 1200)
+++ MOAB/trunk/configure.in	2007-07-12 22:38:46 UTC (rev 1201)
@@ -3,7 +3,7 @@
 ################################################################################
 AC_INIT(MOAB, 3.0)
 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(MOAB,3.0)
+AM_INIT_AUTOMAKE
 
 SNL_CHECK_COMPILERS
 AM_CONDITIONAL(PARALLEL,[test "x$WITH_MPI" != "xno"])
@@ -24,7 +24,31 @@
 AC_SUBST([ZCAT])
 AM_CONDITIONAL([HAVE_ZCAT],[test "x" = "x$ZCAT"])
 
+
 ################################################################################
+#                              Version Stuff
+################################################################################
+
+AC_DEFINE(MB_VERSION,["AC_PACKAGE_VERSION"],[MOAB Version])
+VERSION_MAJOR=`expr AC_PACKAGE_VERSION : '\([[0-9]]\+\)'`
+VERSION_MINOR=`expr AC_PACKAGE_VERSION : '[[0-9]]*\.\([[0-9]]\+\)'`
+VERSION_PATCH=`expr AC_PACKAGE_VERSION : '[[0-9]]*\.[[0-9]]*\.\(.*\)'`
+test "x" != "x$VERSION_MAJOR" || AC_MSG_ERROR("Invalid version string: AC_PACKAGE_VERSION")
+test "x" != "x$VERSION_MINOR" || AC_MSG_ERROR("Invalid version string: AC_PACKAGE_VERSION")
+AC_DEFINE_UNQUOTED(MB_VERSION_MAJOR,$VERSION_MAJOR,[MOAB Major Version])
+AC_DEFINE_UNQUOTED(MB_VERSION_MINOR,$VERSION_MINOR,[MOAB Minor Version])
+if test "x" != "x$VERSION_PATCH"; then
+  AC_DEFINE_UNQUOTED(MB_VERSION_PATCH,$VERSION_PATCH,[MOAB Patch Level])
+  VERSION_STRING="AC_PACKAGE_STRING"
+elif test $VERSION_MINOR -eq 99; then
+  VERSION_STRING="AC_PACKAGE_STRING (Alpha)"
+else
+  VERSION_STRING="AC_PACKAGE_STRING (Beta)"
+fi
+AC_DEFINE_UNQUOTED(MB_VERSION_STRING,"${VERSION_STRING}",[MOAB Version String])
+
+
+################################################################################
 #                              Extract libtool config
 ################################################################################
 ITAPS_LIBTOOL_VAR( [CXX], [compiler_lib_search_path], [MOAB_CXX_LDFLAGS])
@@ -703,6 +727,7 @@
 
 AC_ARG_VAR([FC], [FORTRAN compiler command])
 AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([MBVersion.h])
 AC_CONFIG_HEADERS([MBEntityHandle.h])
 AC_CONFIG_HEADERS([tools/iMesh/iBase_FCDefs.h])
 AC_CONFIG_FILES([Makefile 




More information about the moab-dev mailing list