Fix cmake minizip version check.

Fix Cmake minizip version check that had an incorrect regex and
resulted in the package not being found.

Issue #405
This commit is contained in:
John McNamara 2023-08-03 01:07:49 +01:00
parent fe26f9a130
commit 4aaca54c41

View File

@ -90,9 +90,9 @@ FindStaticLibs(MINIZIP)
# -------
if(MINIZIP_FOUND)
file(STRINGS "${MINIZIP_INCLUDE_DIRS}/zlib.h" MINIZIP_VERSION_CONTENTS REGEX "Version [0-9]+\\.[0-9]+(\\.[0-9]+)?")
string(REGEX REPLACE ".*Version ([0-9]+)\\.[0-9]+" "\\1" MINIZIP_VERSION_MAJOR "${MINIZIP_VERSION_CONTENTS}")
string(REGEX REPLACE ".*Version [0-9]+\\.([0-9]+)" "\\1" MINIZIP_VERSION_MINOR "${MINIZIP_VERSION_CONTENTS}")
file(STRINGS "${MINIZIP_INCLUDE_DIRS}/zlib.h" MINIZIP_VERSION_CONTENTS REGEX "version [0-9]+\\.[0-9]+(\\.[0-9]+)?")
string(REGEX REPLACE ".*version ([0-9]+)\\.[0-9]+" "\\1" MINIZIP_VERSION_MAJOR "${MINIZIP_VERSION_CONTENTS}")
string(REGEX REPLACE ".*version [0-9]+\\.([0-9]+)" "\\1" MINIZIP_VERSION_MINOR "${MINIZIP_VERSION_CONTENTS}")
set(MINIZIP_VERSION_PATCH 0)
set(MINIZIP_VERSION_STRING "${MINIZIP_VERSION_MAJOR}.${MINIZIP_VERSION_MINOR}.${MINIZIP_VERSION_PATCH}")