[Cmake-commits] CMake branch, next, updated. v3.2.2-2691-g4951e2a

Brad King brad.king at kitware.com
Tue May 12 09:57:58 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4951e2a3a8edc6af8080bf31978acef9f06e0e4a (commit)
       via  c11507340c4ad35367634868734beef320422ec9 (commit)
      from  5ccac647e88eb5dabd10dd3a2bed3a3a5fd5b21e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4951e2a3a8edc6af8080bf31978acef9f06e0e4a
commit 4951e2a3a8edc6af8080bf31978acef9f06e0e4a
Merge: 5ccac64 c115073
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 12 09:57:58 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 12 09:57:58 2015 -0400

    Merge topic 'FindHDF5-version-support' into next
    
    c1150734 FindHDF5: Add version support


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c11507340c4ad35367634868734beef320422ec9
commit c11507340c4ad35367634868734beef320422ec9
Author:     Axel Huebl <a.huebl at hzdr.de>
AuthorDate: Mon May 11 15:22:28 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 12 09:57:27 2015 -0400

    FindHDF5: Add version support
    
    Detect the HDF5 version and set HDF5_VERSION just as we
    detect HDF5_IS_PARALLEL from the header already.

diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 0d58e13..2a92f5c 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -51,6 +51,7 @@
 #                               bindings.
 #   HDF5_LIBRARIES - Required libraries for all requested bindings
 #   HDF5_FOUND - true if HDF5 was found on the system
+#   HDF5_VERSION - HDF5 version in format Major.Minor.Release
 #   HDF5_LIBRARY_DIRS - the full set of library directories
 #   HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
 #   HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
@@ -60,6 +61,7 @@
 
 #=============================================================================
 # Copyright 2009 Kitware, Inc.
+#           2015 Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -335,6 +337,7 @@ if( NOT HDF5_FOUND )
     # If the HDF5 include directory was found, open H5pubconf.h to determine if
     # HDF5 was compiled with parallel IO support
     set( HDF5_IS_PARALLEL FALSE )
+    set( HDF5_VERSION "" )
     foreach( _dir IN LISTS HDF5_INCLUDE_DIRS )
         if( EXISTS "${_dir}/H5pubconf.h" )
             file( STRINGS "${_dir}/H5pubconf.h"
@@ -343,6 +346,16 @@ if( NOT HDF5_FOUND )
             if( HDF5_HAVE_PARALLEL_DEFINE )
                 set( HDF5_IS_PARALLEL TRUE )
             endif()
+            unset(HDF5_HAVE_PARALLEL_DEFINE)
+
+            file( STRINGS "${_dir}/H5pubconf.h"
+                HDF5_VERSION_DEFINE
+                REGEX "^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+" )
+            if( "${HDF5_VERSION_DEFINE}" MATCHES
+                "H5_VERSION[ \t]+\"([0-9]+\\.[0-9]+\\.[0-9]+).*\"" )
+                set( HDF5_VERSION "${CMAKE_MATCH_1}" )
+            endif()
+            unset(HDF5_VERSION_DEFINE)
         endif()
     endforeach()
     set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL
@@ -357,8 +370,8 @@ if( NOT HDF5_FOUND )
 
 endif()
 
-find_package_handle_standard_args( HDF5 DEFAULT_MSG
-    HDF5_LIBRARIES
-    HDF5_INCLUDE_DIRS
+find_package_handle_standard_args( HDF5
+    REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS
+    VERSION_VAR   HDF5_VERSION
 )
 
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index 15493be..bdc2563 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -86,8 +86,8 @@ foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG
     check_version_string(${VTEST} ${VTEST}_VERSION_STRING)
 endforeach()
 
-foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 LibArchive OPENSCENEGRAPH
-        RUBY SWIG)
+foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2
+        HDF5 LibArchive OPENSCENEGRAPH RUBY SWIG)
     check_version_string(${VTEST} ${VTEST}_VERSION)
 endforeach()
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindHDF5.cmake                        |   19 ++++++++++++++++---
 Tests/CMakeOnly/AllFindModules/CMakeLists.txt |    4 ++--
 2 files changed, 18 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list