[Cmake-commits] CMake branch, next, updated. v3.6.0-775-g4fd926b

Brad King brad.king at kitware.com
Mon Jul 11 13:36:51 EDT 2016


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  4fd926b7feab3d7f36ae9316a5f36e4e9aed1da9 (commit)
       via  a7d2852634aa40cbd6e7177587b42607986aca6b (commit)
      from  230ad0d96f390c5e4b300f4cb3103e341556f542 (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=4fd926b7feab3d7f36ae9316a5f36e4e9aed1da9
commit 4fd926b7feab3d7f36ae9316a5f36e4e9aed1da9
Merge: 230ad0d a7d2852
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jul 11 13:36:50 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 11 13:36:50 2016 -0400

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7d2852634aa40cbd6e7177587b42607986aca6b
commit a7d2852634aa40cbd6e7177587b42607986aca6b
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Mon Jul 11 11:26:24 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 11 13:35:32 2016 -0400

    FindHDF5: Fix h5cc arg parsing to work with homebrew on Mac
    
    Fixes #16190.

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:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list