Improve messages when trying to detect HDF5
This commit is contained in:
committed by
Yorik van Havre
parent
4746396e7c
commit
9ccfefb112
@@ -713,11 +713,13 @@ endif()
|
||||
STRING(FIND "${TMPTXT}" "#define MED_HAVE_MPI" matchres)
|
||||
if(${matchres} EQUAL -1)
|
||||
message(STATUS "We guess that libmed was built using hdf5-serial version")
|
||||
pkg_search_module(HDF5 hdf5-serial)
|
||||
set(HDF5_VARIANT "hdf5-serial")
|
||||
else()
|
||||
message(STATUS "We guess that libmed was built using hdf5-openmpi version")
|
||||
pkg_search_module(HDF5 hdf5-openmpi)
|
||||
set(HDF5_VARIANT "hdf5-openmpi")
|
||||
set(HDF5_PREFER_PARALLEL TRUE) # if pkg-config fails, find_package(HDF5) needs this
|
||||
endif()
|
||||
pkg_search_module(HDF5 ${HDF5_VARIANT})
|
||||
if(NOT HDF5_FOUND)
|
||||
find_package(HDF5 REQUIRED)
|
||||
else()
|
||||
@@ -726,7 +728,7 @@ endif()
|
||||
link_libraries(${HDF5_LIBRARIES})
|
||||
find_file(Hdf5dotH hdf5.h PATHS ${HDF5_INCLUDE_DIRS} NO_DEFAULT_PATH)
|
||||
if(NOT Hdf5dotH)
|
||||
message( FATAL_ERROR "hdf5-serial not found in an error message above.")
|
||||
message( FATAL_ERROR "${HDF5_VARIANT} development header not found.")
|
||||
endif()
|
||||
endif()
|
||||
check_include_file_cxx(hdf5.h HDF5_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user