Skip to content

Commit

Permalink
Merge pull request #6888 from OSGeo/backport-6887-to-release/3.6
Browse files Browse the repository at this point in the history
[Backport release/3.6] Locate blosc version number when running CMake
  • Loading branch information
rouault committed Dec 10, 2022
2 parents 68ec994 + e57c052 commit c6e0fba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmake/modules/packages/FindBlosc.cmake
Expand Up @@ -43,14 +43,14 @@ if(NOT BLOSC_FOUND)
mark_as_advanced(BLOSC_INCLUDE_DIR BLOSC_LIBRARY)
if(BLOSC_INCLUDE_DIR)
file(STRINGS ${BLOSC_INCLUDE_DIR}/blosc.h _ver_strings
REGEX "BLOSC_VERSION_[^ ]* [0-9]+"
REGEX "BLOSC_VERSION_[^ ]*[ \t]*[0-9]+"
)
foreach(v IN LISTS _ver_strings)
string(REGEX MATCH "BLOSC_VERSION_([^ ]+) ([0-9]+)" v "${v}")
string(REGEX MATCH "BLOSC_VERSION_([^ ]*)[ \t]*([0-9]+)" v "${v}")
set(BLOSC_VERSION_${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
endforeach()
set(BLOSC_VERSION
${BLOSC_VERSION_MAJOR}.${BLOSC_VERSION_MINOR}.${BLOSC_VERSION_PATCH}
${BLOSC_VERSION_MAJOR}.${BLOSC_VERSION_MINOR}.${BLOSC_VERSION_RELEASE}
)
endif()

Expand Down

0 comments on commit c6e0fba

Please sign in to comment.