Skip to content

Commit 326baa6

Browse files
committed
build HDF5: correct paths
1 parent 5a0465d commit 326baa6

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

cmake/hdf5.cmake

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ foreach(_name IN ITEMS hdf5_hl_fortran hdf5_hl_f90cstub hdf5_fortran hdf5_f90cst
1818
# need ${CMAKE_INSTALL_PREFIX}/lib as HDF5 doesn't use GNUInstallDirs
1919
if(BUILD_SHARED_LIBS)
2020
if(WIN32)
21-
list(APPEND HDF5_LIBRARIES ${CMAKE_INSTALL_PREFIX}/lib/lib${_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
21+
list(APPEND HDF5_LIBRARIES ${CMAKE_INSTALL_FULL_BINDIR}/lib${_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
2222
else()
2323
list(APPEND HDF5_LIBRARIES ${CMAKE_INSTALL_PREFIX}/lib/lib${_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
2424
endif()
@@ -57,20 +57,27 @@ set(hdf5_cmake_args
5757
-DHDF5_BUILD_CPP_LIB:BOOL=false
5858
-DBUILD_TESTING:BOOL=false
5959
-DHDF5_BUILD_EXAMPLES:BOOL=false
60-
-DHDF5_BUILD_TOOLS:BOOL=$<NOT:$<BOOL:${hdf5_parallel}>>
60+
-DHDF5_BUILD_TOOLS:BOOL=true
6161
-DHDF5_ENABLE_PARALLEL:BOOL=$<BOOL:${hdf5_parallel}>
62-
-DHDF5_BUILD_PARALLEL_TOOLS:BOOL=false
62+
-DHDF5_BUILD_PARALLEL_TOOLS:BOOL=$<BOOL:${hdf5_parallel}>
6363
)
64-
# https://github.com/HDFGroup/hdf5/issues/818 for broken ph5diff in HDF5_BUILD_TOOLS
65-
# avoid building tools as some HDF5 versions have build failures or broken tools
6664

6765
#-DHDF5_USE_GNU_DIRS:BOOL=ON # not yet, new for 1.14
6866

6967
if(MPI_ROOT)
7068
list(APPEND hdf5_cmake_args -DMPI_ROOT:PATH=${MPI_ROOT})
7169
endif()
7270

73-
string(JSON hdf5_url GET ${json} hdf5 url)
71+
if(NOT hdf5_url)
72+
string(JSON hdf5_url GET ${json} hdf5 url)
73+
endif()
74+
75+
# Get HDF5 version from underscore-separated version in URL
76+
77+
string(REGEX MATCH "[0-9]+_[0-9]+_[0-9]+" HDF5_VERSION "${hdf5_url}")
78+
string(REPLACE "_" "." HDF5_VERSION "${HDF5_VERSION}")
79+
80+
message(STATUS "Building HDF5 ${HDF5_VERSION}")
7481

7582
ExternalProject_Add(HDF5
7683
URL ${hdf5_url}

0 commit comments

Comments
 (0)