Use HDF5_FOUND to control autoconf and CMake built FindHDF5.
This commit is contained in:
parent
2ba826e060
commit
4e12284424
|
@ -180,8 +180,9 @@ macro( _HDF5_parse_compile_line
|
|||
endmacro()
|
||||
|
||||
# Try to find HDF5 using an installed hdf5-config.cmake
|
||||
if( NOT HDF5_FOUND )
|
||||
find_package( HDF5 QUIET NO_MODULE )
|
||||
if( HDF5_INCLUDE_DIR )
|
||||
if( HDF5_FOUND )
|
||||
set( HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR} )
|
||||
set( HDF5_LIBRARIES )
|
||||
set( HDF5_C_TARGET hdf5 )
|
||||
|
@ -199,11 +200,9 @@ if( HDF5_INCLUDE_DIR )
|
|||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
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
|
||||
else()
|
||||
if( NOT HDF5_FOUND )
|
||||
_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 )
|
||||
|
@ -259,9 +258,7 @@ 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.
|
||||
|
@ -358,6 +355,7 @@ find_package_handle_standard_args( HDF5 DEFAULT_MSG
|
|||
HDF5_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
if( HDF5_FOUND )
|
||||
mark_as_advanced(
|
||||
HDF5_INCLUDE_DIRS
|
||||
HDF5_LIBRARIES
|
||||
|
@ -370,4 +368,5 @@ mark_as_advanced(
|
|||
# For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
|
||||
# HDF5_INCLUDE_DIRS
|
||||
set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in New Issue