Skip to content

Commit

Permalink
Merge pull request #525 from jsberg-bnl/find-hdf5
Browse files Browse the repository at this point in the history
Search for HDF5 include and library directories in Master.cmake
  • Loading branch information
DavidSagan authored Sep 29, 2023
2 parents 7e21fb6 + 45ee929 commit 83b6239
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions util/Master.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,15 @@ SET (MASTER_INC_DIRS
${X11_INCLUDE_DIR}
)

# If we use system HDF5 libraries, search for include directories
find_package(HDF5 COMPONENTS Fortran)
foreach(h5dir ${HDF5_Fortran_INCLUDE_DIRS})
list(FIND CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES "${h5dir}" h5found)
if (h5found EQUAL -1)
list(APPEND MASTER_INC_DIRS "${h5dir}")
endif()
endforeach()

# If building for HARDWARE-DEVEL, remove the include directories which are not needed

IF (CMAKE_SYSTEM_NAME MATCHES "HARDWARE-DEVEL")
Expand Down Expand Up @@ -549,6 +558,13 @@ SET (MASTER_LINK_DIRS
${ACC_LIB_DIRS}
)

foreach(h5dir ${HDF5_Fortran_LIBRARY_DIRS})
list(FIND CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "${h5dir}" h5found)
if (h5found EQUAL -1)
list(APPEND MASTER_LINK_DIRS "${h5dir}")
endif()
endforeach()

IF (DEBUG)
IF (IS_DIRECTORY "${PACKAGES_DIR}/debug/lib/root")
LIST (APPEND MASTER_LINK_DIRS "${PACKAGES_DIR}/debug/lib/root")
Expand Down

0 comments on commit 83b6239

Please sign in to comment.