1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 10:47:59 +08:00

FindHDF5: Fix detection of versions with more than three components

Fix detecting the version of HDF5 1.14.4.2.

Fixes: #25945
This commit is contained in:
مهدي شينون (Mehdi Chinoune)
2024-04-30 09:10:12 +01:00
committed by Brad King
parent 2ee4ac0210
commit 928943f91b

View File

@@ -987,7 +987,7 @@ if( NOT HDF5_FOUND )
HDF5_VERSION_DEFINE
REGEX "^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+" )
if( "${HDF5_VERSION_DEFINE}" MATCHES
"H5_VERSION[ \t]+\"([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?\"" )
"H5_VERSION[ \t]+\"([0-9\\.]+)(-patch([0-9]+))?\"" )
set( HDF5_VERSION "${CMAKE_MATCH_1}" )
if( CMAKE_MATCH_3 )
set( HDF5_VERSION ${HDF5_VERSION}.${CMAKE_MATCH_3})