Skip to content

Commit

Permalink
guard use of env for hdf5 with cmake version
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Oct 19, 2020
1 parent 9fcf062 commit de840b5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/config/conduit_setup_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ if(CONDUIT_HDF5_DIR)
set(HDF5_ROOT ${HDF5_DIR_REAL})

if(NOT WIN32)
set(ENV{HDF5_ROOT} ${HDF5_ROOT}/bin)
# Use CMake's FindHDF5 module, which uses hdf5's compiler wrappers to extract
# all the info about the hdf5 install
include(FindHDF5)
# use HDF5_ROOT env var for FindHDF5 with older versions of cmake
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
set(ENV{HDF5_ROOT} ${HDF5_ROOT}/bin)
endif()

# Use CMake's FindHDF5 module to locate hdf5 and setup hdf5
find_package(HDF5 REQUIRED)
else()
# CMake's FindHDF5 module is buggy on windows and will put the dll
# in HDF5_LIBRARY. Instead, use the 'CONFIG' signature of find_package
Expand Down

0 comments on commit de840b5

Please sign in to comment.