Skip to content

Commit f760599

Browse files
committed
cmake:windows:oneapi: correct regex for workaround
1 parent 9544e27 commit f760599

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ if(h5fortran_IS_TOP_LEVEL AND (hdf5_parallel OR HDF5_HAVE_PARALLEL))
4949
target_link_libraries(HDF5::HDF5 INTERFACE MPI::MPI_Fortran)
5050
endif()
5151

52-
# HDF5 bug #3663 for HDF5 1.14.2..4, ...?
52+
# HDF5 bug #3663 for HDF5 1.14.2..5, ...?
5353
# https://github.com/HDFGroup/hdf5/issues/3663
5454
if(WIN32 AND CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
55-
if(HDF5_VERSION MATCHES "1.14.[2-4]")
56-
message(VERBOSE "HDF5: applying workaround for HDF5 bug #3663 with Intel oneAPI on Windows")
55+
if(HDF5_VERSION MATCHES "1.14.[2-5]")
56+
message(STATUS "HDF5: applying workaround for HDF5 bug #3663 with Intel oneAPI on Windows")
5757
target_link_libraries(HDF5::HDF5 INTERFACE shlwapi)
5858
endif()
5959
endif()

cmake/hdf5.cmake

+4-3
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ endif()
7474

7575
# Get HDF5 version from underscore-separated version in URL
7676

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

80-
message(STATUS "Building HDF5 ${HDF5_VERSION}")
81+
message(STATUS "Building HDF5 version ${HDF5_VERSION}")
8182

8283
ExternalProject_Add(HDF5
8384
URL ${hdf5_url}

0 commit comments

Comments
 (0)