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  230ad0d96f390c5e4b300f4cb3103e341556f542 (commit)
       via  7f3c28a4acfee737db0079a98a76eafc5f3af7e2 (commit)
      from  cfdb1592487c71e046d4f08d63d828d54b712e94 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=230ad0d96f390c5e4b300f4cb3103e341556f542
commit 230ad0d96f390c5e4b300f4cb3103e341556f542
Merge: cfdb159 7f3c28a
Author:     Chuck Atkins <chuck.atk...@kitware.com>
AuthorDate: Mon Jul 11 12:06:04 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Jul 11 12:06:04 2016 -0400

    Merge topic 'fix-hdf5-homebrew' into next
    
    7f3c28a4 FindHDF5: Fix h5cc arg parsing to work with homebrew on Mac


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f3c28a4acfee737db0079a98a76eafc5f3af7e2
commit 7f3c28a4acfee737db0079a98a76eafc5f3af7e2
Author:     Chuck Atkins <chuck.atk...@kitware.com>
AuthorDate: Mon Jul 11 11:26:24 2016 -0400
Commit:     Chuck Atkins <chuck.atk...@kitware.com>
CommitDate: Mon Jul 11 12:01:36 2016 -0400

    FindHDF5: Fix h5cc arg parsing to work with homebrew on Mac

diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index b074f63..f644a17 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -267,8 +267,20 @@ endfunction()
 # return_value argument, the text output is stored to the output variable.
 macro( _HDF5_invoke_compiler language output return_value version)
     set(${version})
+    if(HDF5_USE_STATIC_LIBRARIES)
+       set(_ltargs -noshlib)
+     else()
+       set(_ltargs -shlib)
+    endif()
+    if(language STREQUAL "C")
+        set(_sourcefile test_hdf5.c)
+    elseif(language STREQUAL "CXX")
+        set(_sourcefile test_hdf5.cxx)
+    elseif(language STREQUAL "Fortran")
+        set(_sourcefile test_hdf5.f90)
+    endif()
     exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
-        ARGS -show
+        ARGS -show ${_ltargs} ${_sourcefile}
         OUTPUT_VARIABLE ${output}
         RETURN_VALUE ${return_value}
     )
@@ -321,7 +333,6 @@ macro( _HDF5_parse_compile_line
     string( REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" library_path_flags
         "${${compile_line_var}}"
     )
-
     foreach( LPATH ${library_path_flags} )
         string( REGEX REPLACE "^-L" "" LPATH ${LPATH} )
         string( REPLACE "//" "/" LPATH ${LPATH} )
@@ -331,17 +342,32 @@ macro( _HDF5_parse_compile_line
     # now search for the library names specified in the compile line (match 
-l...)
     # match only -l's preceded by a space or comma
     # this is to exclude directory names like xxx-linux/
-    string( REGEX MATCHALL "[, ]-l([^\", ]+)" library_name_flags
+    string( REGEX MATCHALL "[, ]+-l([^\", ]+)" library_name_flags
         "${${compile_line_var}}" )
-    # strip the -l from all of the library flags and add to the search list
     foreach( LIB ${library_name_flags} )
-        string( REGEX REPLACE "^[, ]-l" "" LIB ${LIB} )
-        if(LIB MATCHES ".*_hl")
+        string( REGEX REPLACE "^[, ]+-l" "" LIB ${LIB} )
+        if(LIB MATCHES ".*hl")
             list(APPEND ${libraries_hl} ${LIB})
         else()
             list(APPEND ${libraries} ${LIB})
         endif()
     endforeach()
+
+    # now search for full library paths with no flags
+    string( REGEX MATCHALL "[, ][^\-]([^\", ]+)" library_name_noflags
+        "${${compile_line_var}}" )
+    foreach( LIB ${library_name_noflags})
+        string( REGEX REPLACE "^[, ]+" "" LIB ${LIB} )
+        get_filename_component(LIB_DIR ${LIB} DIRECTORY)
+        get_filename_component(LIB_NAME ${LIB} NAME_WE)
+        string( REGEX REPLACE "^lib" "" LIB_NAME ${LIB_NAME} )
+        list( APPEND ${library_paths} ${LIB_DIR} )
+        if(LIB_NAME MATCHES ".*hl")
+            list(APPEND ${libraries_hl} ${LIB_NAME})
+        else()
+            list(APPEND ${libraries} ${LIB_NAME})
+        endif()
+    endforeach()
 endmacro()
 
 # Try to find HDF5 using an installed hdf5-config.cmake
@@ -459,6 +485,14 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
             HDF5_${__lang}_HL_LIBRARY_NAMES
           )
           set(HDF5_${__lang}_LIBRARIES)
+
+          set(_HDF5_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+          if(HDF5_USE_STATIC_LIBRARIES)
+            set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
+          else()
+            set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
+          endif()
+
           foreach(L IN LISTS HDF5_${__lang}_LIBRARY_NAMES)
             find_library(HDF5_${__lang}_LIBRARY_${L} ${L} 
${HDF5_${__lang}_LIBRARY_DIRS})
             if(HDF5_${__lang}_LIBRARY_${L})
@@ -478,6 +512,9 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
               endif()
             endforeach()
           endif()
+
+          set(CMAKE_FIND_LIBRARY_SUFFIXES ${_HDF5_CMAKE_FIND_LIBRARY_SUFFIXES})
+
           set(HDF5_${__lang}_FOUND True)
           mark_as_advanced(HDF5_${__lang}_DEFINITIONS)
           mark_as_advanced(HDF5_${__lang}_INCLUDE_DIRS)

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

Summary of changes:
 Modules/FindHDF5.cmake |   49 ++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to