summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-07-08 13:50:49 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-07-08 13:50:49 (GMT)
commit47834df86df6f8a552410435cbef8f757e93a223 (patch)
treebb562d59c457179293e044f1b27a7c25e169e413
parentb3162a67e0c9fa0148946c535056216a3a6aadb0 (diff)
downloadhdf5-47834df86df6f8a552410435cbef8f757e93a223.zip
hdf5-47834df86df6f8a552410435cbef8f757e93a223.tar.gz
hdf5-47834df86df6f8a552410435cbef8f757e93a223.tar.bz2
[svn-r19056] Added code to retrieve version info from H5public.h; corrected a typo in a configure check and a macro
-rw-r--r--CMakeLists.txt16
-rw-r--r--ConfigureChecks.cmake2
-rw-r--r--Resources/HDF5Macros.cmake2
3 files changed, 14 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5430cc7..d71ad9a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,10 +78,6 @@ PROJECT (HDF5 C CXX)
#-----------------------------------------------------------------------------
# Basic HDF5 stuff here
#-----------------------------------------------------------------------------
-SET (H5_VERS_MAJOR 1)
-SET (H5_VERS_MINOR 9)
-SET (H5_VERS_RELEASE 72)
-#-----------------------------------------------------------------------------
SET (HDF5_PACKAGE "hdf5")
SET (HDF5_PACKAGE_NAME "HDF5")
SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}")
@@ -347,6 +343,18 @@ IF (CMAKE_COMPILER_IS_GNUCXX)
ENDIF (CMAKE_COMPILER_IS_GNUCXX)
#-----------------------------------------------------------------------------
+# parse the full version number from H5public.h and include in H5_VERS_INFO
+#-----------------------------------------------------------------------------
+FILE (READ ${HDF5_SRC_DIR}/H5public.h _h5public_h_contents)
+STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$"
+ "\\1" H5_VERS_MAJOR ${_h5public_h_contents})
+STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$"
+ "\\1" H5_VERS_MINOR ${_h5public_h_contents})
+STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$"
+ "\\1" H5_VERS_RELEASE ${_h5public_h_contents})
+#MESSAGE (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}")
+
+#-----------------------------------------------------------------------------
# All libs/tests/examples need the main include directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR})
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 27fb1a8..f2cd86d 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -551,7 +551,7 @@ ENDIF (INLINE_TEST___inline__)
#-----------------------------------------------------------------------------
# Check how to print a Long Long integer
#-----------------------------------------------------------------------------
-SET (H5_H5_PRINTF_LL_WIDTH "H5_PRINTF_LL_WIDTH")
+SET (H5_PRINTF_LL_WIDTH "H5_PRINTF_LL_WIDTH")
IF (H5_PRINTF_LL_WIDTH MATCHES "^H5_PRINTF_LL_WIDTH$")
SET (PRINT_LL_FOUND 0)
MESSAGE (STATUS "Checking for appropriate format for 64 bit long:")
diff --git a/Resources/HDF5Macros.cmake b/Resources/HDF5Macros.cmake
index cb1b300..8b30fbf 100644
--- a/Resources/HDF5Macros.cmake
+++ b/Resources/HDF5Macros.cmake
@@ -98,7 +98,7 @@ MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype)
IF (BUILD_SHARED_LIBS)
IF (WIN32)
- SET (LIBHDF_VERSION HDF5_PACKAGE_VERSION_MAJOR)
+ SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR})
ELSE (WIN32)
SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION})
ENDIF (WIN32)