Fix zlib-ng version parse

Currently, zlib-ng version is 'zlib ver #define ZLIB_VERSION "1.3.0.zlib-ng"'. Because ocv_parse_header_version only accepts dot and numbers and doesn't accepts 1.3.0.zlib-ng. This patch changes ocv_parse_header_version to accept all characters between parentheses.
This commit is contained in:
Letu Ren 2024-05-13 19:32:00 +08:00
parent 1d9a4120fa
commit 023d805492

View File

@ -1438,7 +1438,7 @@ macro(ocv_parse_header_version LIBNAME HDR_PATH LIBVER)
file(STRINGS "${HDR_PATH}" ${LIBNAME}_H REGEX "^#define[ \t]+${LIBVER}[ \t]+\"[^\"]*\".*$" LIMIT_COUNT 1)
endif()
if(${LIBNAME}_H)
string(REGEX REPLACE "^.*[ \t]${LIBVER}[ \t]+\"([0-9\.]+)\"$" "\\1" ${LIBNAME}_VERSION_STRING "${${LIBNAME}_H}")
string(REGEX REPLACE "^.*[ \t]${LIBVER}[ \t]+\"(.+)\"$" "\\1" ${LIBNAME}_VERSION_STRING "${${LIBNAME}_H}")
endif()
endmacro()