Skip to content

Commit

Permalink
add extra abs_path check to hdf5 cmake sanity checks (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Jun 12, 2017
1 parent 08fde31 commit 49e6238
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/CMake/thirdparty/SetupHDF5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,24 @@ set(HDF5_DIR ${HDF5_ROOT} CACHE PATH "" FORCE)
#
message(STATUS "Checking that found HDF5_INCLUDE_DIRS are in HDF5_DIR")


foreach(IDIR ${HDF5_INCLUDE_DIRS})
if("${IDIR}" MATCHES "${HDF5_DIR}")
message(STATUS " ${IDIR} includes HDF5_DIR")

message(STATUS " ${IDIR} includes HDF5_DIR (${HDF5_DIR})")
else()
message(FATAL_ERROR " ${IDIR} does not include HDF5_DIR")

# The check above could fail b/c of relative vs abs path
# compare. It's not clear if FindHDF5 will always resolve
# relative paths to abs ones, so out of caution we check
# both.

get_filename_component(ABSOLUTE_PATH ${HDF5_DIR} HDF5_DIR_ABS)

if("${IDIR}" MATCHES "${HDF5_DIR_ABS}")
message(STATUS " ${IDIR} includes HDF5_DIR (${HDF5_DIR_ABS})")
else()
message(FATAL_ERROR " ${IDIR} does not include HDF5_DIR")
endif()
endif()
endforeach()

Expand Down

0 comments on commit 49e6238

Please sign in to comment.