Skip to content

Commit

Permalink
cmake:windows:oneapi: correct regex for workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Oct 10, 2024
1 parent 9544e27 commit f760599
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ if(h5fortran_IS_TOP_LEVEL AND (hdf5_parallel OR HDF5_HAVE_PARALLEL))
target_link_libraries(HDF5::HDF5 INTERFACE MPI::MPI_Fortran)
endif()

# HDF5 bug #3663 for HDF5 1.14.2..4, ...?
# HDF5 bug #3663 for HDF5 1.14.2..5, ...?
# https://github.com/HDFGroup/hdf5/issues/3663
if(WIN32 AND CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
if(HDF5_VERSION MATCHES "1.14.[2-4]")
message(VERBOSE "HDF5: applying workaround for HDF5 bug #3663 with Intel oneAPI on Windows")
if(HDF5_VERSION MATCHES "1.14.[2-5]")
message(STATUS "HDF5: applying workaround for HDF5 bug #3663 with Intel oneAPI on Windows")
target_link_libraries(HDF5::HDF5 INTERFACE shlwapi)
endif()
endif()
Expand Down
7 changes: 4 additions & 3 deletions cmake/hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ endif()

# Get HDF5 version from underscore-separated version in URL

string(REGEX MATCH "[0-9]+_[0-9]+_[0-9]+" HDF5_VERSION "${hdf5_url}")
string(REPLACE "_" "." HDF5_VERSION "${HDF5_VERSION}")
if(hdf5_url MATCHES "hdf5_([0-9]+\.[0-9]+\.[0-9]+)\.")
set(HDF5_VERSION "${CMAKE_MATCH_1}")
endif()

message(STATUS "Building HDF5 ${HDF5_VERSION}")
message(STATUS "Building HDF5 version ${HDF5_VERSION}")

ExternalProject_Add(HDF5
URL ${hdf5_url}
Expand Down

0 comments on commit f760599

Please sign in to comment.