[Cmake-commits] CMake branch, next, updated. v2.8.4-1548-g994990b

Will Dicharry wdicharry at stellarscience.com
Mon May 16 17:49:03 EDT 2011


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  994990ba19e875639e07eddfbfccae7a0ebec1da (commit)
       via  3978f3221fd58bc719ee5848d8cc41d0b0f6e47d (commit)
       via  063ac873ce004ab1affe78be3fe0344a6f87cb79 (commit)
       via  34ea17901372f02b949907662c939916b2eea453 (commit)
      from  5be39b5f028672e8dc2100451afca10b41c9b0b5 (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=994990ba19e875639e07eddfbfccae7a0ebec1da
commit 994990ba19e875639e07eddfbfccae7a0ebec1da
Merge: 5be39b5 3978f32
Author:     Will Dicharry <wdicharry at stellarscience.com>
AuthorDate: Mon May 16 17:49:00 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon May 16 17:49:00 2011 -0400

    Merge topic 'hdf5-module-bug-fix' into next
    
    3978f32 Add logic for CMake built HDF5 install.
    063ac87 HDF5 high level library is a find COMPONENT now.
    34ea179 Modified the FindHDF5.cmake file to locate the Fortran bindings.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3978f3221fd58bc719ee5848d8cc41d0b0f6e47d
commit 3978f3221fd58bc719ee5848d8cc41d0b0f6e47d
Author:     Will Dicharry <wdicharry at stellarscience.com>
AuthorDate: Mon May 16 14:19:22 2011 -0600
Commit:     Will Dicharry <wdicharry at stellarscience.com>
CommitDate: Mon May 16 15:41:18 2011 -0600

    Add logic for CMake built HDF5 install.
    
    The find module calls find_package( HDF5 QUIET NO_MODULE ). If that succeeds,
    the find module variables are set based on the imported target locations.

diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 878a355..f3afb69 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -69,6 +69,22 @@ set( HDF5_VALID_COMPONENTS
     HL
 )
 
+# Validate the list of find components.
+if( NOT HDF5_FIND_COMPONENTS )
+    set( HDF5_LANGUAGE_BINDINGS "C" )
+else()
+    # add the extra specified components, ensuring that they are valid.
+    foreach( component ${HDF5_FIND_COMPONENTS} )
+        list( FIND HDF5_VALID_COMPONENTS ${component} component_location )
+        if( ${component_location} EQUAL -1 )
+            message( FATAL_ERROR
+                "\"${component}\" is not a valid HDF5 component." )
+        else()
+            list( APPEND HDF5_LANGUAGE_BINDINGS ${component} )
+        endif()
+    endforeach()
+endif()
+
 # try to find the HDF5 wrapper compilers
 find_program( HDF5_C_COMPILER_EXECUTABLE
     NAMES h5cc h5pcc
@@ -163,6 +179,27 @@ macro( _HDF5_parse_compile_line
     endforeach()
 endmacro()
 
+# Try to find HDF5 using an installed hdf5-config.cmake
+find_package( HDF5 QUIET NO_MODULE )
+if( HDF5_INCLUDE_DIR )
+    set( HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR} )
+    set( HDF5_LIBRARIES )
+    set( HDF5_C_TARGET hdf5 )
+    set( HDF5_CXX_TARGET hdf5_cpp )
+    set( HDF5_HL_TARGET hdf5_hl )
+    set( HDF5_Fortran_TARGET hdf5_fortran )
+    foreach( _component ${HDF5_LANGUAGE_BINDINGS} )
+        list( FIND HDF5_VALID_COMPONENTS ${_component} _component_location )
+        get_target_property( _comp_location ${HDF5_${_component}_TARGET} LOCATION )
+        if( _comp_location )
+            set( HDF5_${_component}_LIBRARY ${_comp_location} CACHE PATH
+                "HDF5 ${_component} library" )
+            mark_as_advanced( HDF5_${_component}_LIBRARY )
+            list( APPEND HDF5_LIBRARIES ${HDF5_${_component}_LIBRARY} )
+        endif()
+    endforeach()
+endif()
+
 if( HDF5_INCLUDE_DIRS AND HDF5_LIBRARIES )
     # Do nothing: we already have HDF5_INCLUDE_PATH and HDF5_LIBRARIES in the
     # cache, it would be a shame to override them
@@ -171,21 +208,6 @@ else()
     _HDF5_invoke_compiler( CXX HDF5_CXX_COMPILE_LINE HDF5_CXX_RETURN_VALUE )
     _HDF5_invoke_compiler( Fortran HDF5_Fortran_COMPILE_LINE HDF5_Fortran_RETURN_VALUE )
 
-    if( NOT HDF5_FIND_COMPONENTS )
-        set( HDF5_LANGUAGE_BINDINGS "C" )
-    else()
-        # add the extra specified components, ensuring that they are valid.
-        foreach( component ${HDF5_FIND_COMPONENTS} )
-            list( FIND HDF5_VALID_COMPONENTS ${component} component_location )
-            if( ${component_location} EQUAL -1 )
-                message( FATAL_ERROR  
-                    "\"${component}\" is not a valid HDF5 component." )
-            else()
-                list( APPEND HDF5_LANGUAGE_BINDINGS ${component} )
-            endif()
-        endforeach()
-    endif()
-    
     # seed the initial lists of libraries to find with items we know we need
     set( HDF5_C_LIBRARY_NAMES_INIT hdf5 )
     set( HDF5_HL_LIBRARY_NAMES_INIT hdf5_hl ${HDF5_C_LIBRARY_NAMES_INIT} )

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=063ac873ce004ab1affe78be3fe0344a6f87cb79
commit 063ac873ce004ab1affe78be3fe0344a6f87cb79
Author:     Will Dicharry <wdicharry at stellarscience.com>
AuthorDate: Mon May 16 13:22:57 2011 -0600
Commit:     Will Dicharry <wdicharry at stellarscience.com>
CommitDate: Mon May 16 15:36:47 2011 -0600

    HDF5 high level library is a find COMPONENT now.
    
    The HDF5 high level library was originally hard coded as a dependency when the C
    bindings are desired. The high level API is now requested as a COMPONENT.

diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 5c500a2..878a355 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -10,7 +10,7 @@
 # are specified, then the find module will default to finding only the HDF5 C
 # library.  If one or more COMPONENTS are specified, the module will attempt to
 # find the language bindings for the specified components.  The only valid
-# components are C, CXX, and Fortran.  If the COMPONENTS argument is not
+# components are C, CXX, Fortran, and HL.  If the COMPONENTS argument is not
 # given, the module will attempt to find only the C bindings.
 #
 # On UNIX systems, this module will read the variable HDF5_USE_STATIC_LIBRARIES
@@ -33,6 +33,7 @@
 #  HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings.
 #  HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
 #  HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
+#  HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API
 #  HDF5_LIBRARIES - Required libraries for all requested bindings
 #  HDF5_FOUND - true if HDF5 was found on the system
 #  HDF5_LIBRARY_DIRS - the full set of library directories
@@ -65,6 +66,7 @@ set( HDF5_VALID_COMPONENTS
     C
     CXX
     Fortran
+    HL
 )
 
 # try to find the HDF5 wrapper compilers
@@ -185,7 +187,8 @@ else()
     endif()
     
     # seed the initial lists of libraries to find with items we know we need
-    set( HDF5_C_LIBRARY_NAMES_INIT hdf5_hl hdf5 )
+    set( HDF5_C_LIBRARY_NAMES_INIT hdf5 )
+    set( HDF5_HL_LIBRARY_NAMES_INIT hdf5_hl ${HDF5_C_LIBRARY_NAMES_INIT} )
     set( HDF5_CXX_LIBRARY_NAMES_INIT hdf5_cpp ${HDF5_C_LIBRARY_NAMES_INIT} )
     set( HDF5_Fortran_LIBRARY_NAMES_INIT hdf5_fortran ${HDF5_C_LIBRARY_NAMES_INIT} )
     
@@ -234,7 +237,9 @@ else()
             ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
         
         # find the HDF5 libraries
+        message( STATUS "FindHDF5 -- search for ${LANGUAGE}" )
         foreach( LIB ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
+            message( STATUS "FindHDF5 -- Searching for ${LIB}" )
             if( UNIX AND HDF5_USE_STATIC_LIBRARIES )
                 # According to bug 1643 on the CMake bug tracker, this is the
                 # preferred method for searching for a static library.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=34ea17901372f02b949907662c939916b2eea453
commit 34ea17901372f02b949907662c939916b2eea453
Author:     Tim Gallagher <tim.gallagher at gatech.edu>
AuthorDate: Thu Mar 17 17:27:27 2011 -0400
Commit:     Will Dicharry <wdicharry at stellarscience.com>
CommitDate: Mon May 16 15:35:57 2011 -0600

    Modified the FindHDF5.cmake file to locate the Fortran bindings.

diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 90849a1..5c500a2 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -9,10 +9,9 @@
 # The module will optionally accept the COMPONENTS argument.  If no COMPONENTS
 # are specified, then the find module will default to finding only the HDF5 C
 # library.  If one or more COMPONENTS are specified, the module will attempt to
-# find the language bindings for the specified components.  Currently, the only
-# valid components are C and CXX.  The module does not yet support finding the
-# Fortran bindings.  If the COMPONENTS argument is not given, the module will
-# attempt to find only the C bindings.
+# find the language bindings for the specified components.  The only valid
+# components are C, CXX, and Fortran.  If the COMPONENTS argument is not
+# given, the module will attempt to find only the C bindings.
 #
 # On UNIX systems, this module will read the variable HDF5_USE_STATIC_LIBRARIES
 # to determine whether or not to prefer a static link to a dynamic link for HDF5
@@ -33,12 +32,14 @@
 #  HDF5_DEFINITIONS - Required compiler definitions for HDF5
 #  HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings.
 #  HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
+#  HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
 #  HDF5_LIBRARIES - Required libraries for all requested bindings
 #  HDF5_FOUND - true if HDF5 was found on the system
 #  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
 #  HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
+#  HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
 #  HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
 
 #=============================================================================
@@ -57,12 +58,13 @@
 # This module is maintained by Will Dicharry <wdicharry at stellarscience.com>.
 
 include(SelectLibraryConfigurations)
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
 
 # List of the valid HDF5 components
 set( HDF5_VALID_COMPONENTS 
     C
     CXX
+    Fortran
 )
 
 # try to find the HDF5 wrapper compilers
@@ -80,6 +82,13 @@ find_program( HDF5_CXX_COMPILER_EXECUTABLE
     DOC "HDF5 C++ Wrapper compiler.  Used only to detect HDF5 compile flags." )
 mark_as_advanced( HDF5_CXX_COMPILER_EXECUTABLE )
 
+find_program( HDF5_Fortran_COMPILER_EXECUTABLE
+    NAMES h5fc h5pfc
+    HINTS ENV HDF5_ROOT
+    PATH_SUFFIXES bin Bin
+    DOC "HDF5 Fortran Wrapper compiler.  Used only to detect HDF5 compile flags." )
+mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE )
+
 find_program( HDF5_DIFF_EXECUTABLE 
     NAMES h5diff
     HINTS ENV HDF5_ROOT
@@ -158,6 +167,7 @@ if( HDF5_INCLUDE_DIRS AND HDF5_LIBRARIES )
 else()
     _HDF5_invoke_compiler( C HDF5_C_COMPILE_LINE HDF5_C_RETURN_VALUE )
     _HDF5_invoke_compiler( CXX HDF5_CXX_COMPILE_LINE HDF5_CXX_RETURN_VALUE )
+    _HDF5_invoke_compiler( Fortran HDF5_Fortran_COMPILE_LINE HDF5_Fortran_RETURN_VALUE )
 
     if( NOT HDF5_FIND_COMPONENTS )
         set( HDF5_LANGUAGE_BINDINGS "C" )
@@ -177,6 +187,7 @@ else()
     # seed the initial lists of libraries to find with items we know we need
     set( HDF5_C_LIBRARY_NAMES_INIT hdf5_hl hdf5 )
     set( HDF5_CXX_LIBRARY_NAMES_INIT hdf5_cpp ${HDF5_C_LIBRARY_NAMES_INIT} )
+    set( HDF5_Fortran_LIBRARY_NAMES_INIT hdf5_fortran ${HDF5_C_LIBRARY_NAMES_INIT} )
     
     foreach( LANGUAGE ${HDF5_LANGUAGE_BINDINGS} )
         if( HDF5_${LANGUAGE}_COMPILE_LINE )
@@ -198,7 +209,13 @@ else()
         list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} )
     
         # find the HDF5 include directories
-        find_path( HDF5_${LANGUAGE}_INCLUDE_DIR hdf5.h
+        if(${LANGUAGE} STREQUAL "Fortran")
+            set(HDF5_INCLUDE_FILENAME hdf5.mod)
+        else()
+            set(HDF5_INCLUDE_FILENAME hdf5.h)
+        endif()
+
+        find_path( HDF5_${LANGUAGE}_INCLUDE_DIR ${HDF5_INCLUDE_FILENAME}
             HINTS
                 ${HDF5_${LANGUAGE}_INCLUDE_FLAGS}
                 ENV
@@ -320,7 +337,8 @@ mark_as_advanced(
     HDF5_DEFINTIONS
     HDF5_LIBRARY_DIRS
     HDF5_C_COMPILER_EXECUTABLE
-    HDF5_CXX_COMPILER_EXECUTABLE )
+    HDF5_CXX_COMPILER_EXECUTABLE
+    HDF5_Fortran_COMPILER_EXECUTABLE )
 
 # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
 # HDF5_INCLUDE_DIRS

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

Summary of changes:
 Modules/FindHDF5.cmake |   91 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 68 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list