diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt index 30a052861f..9173e207f7 100644 --- a/3rdparty/libtiff/CMakeLists.txt +++ b/3rdparty/libtiff/CMakeLists.txt @@ -361,6 +361,7 @@ set(LIBTIFF_MAJOR_VERSION "4") set(LIBTIFF_MINOR_VERSION "6") set(LIBTIFF_MICRO_VERSION "0") set(LIBTIFF_VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}") +file(READ "RELEASE-DATE" LIBTIFF_RELEASE_DATE content) set(TIFF_MAX_DIR_COUNT "1048576") @@ -427,7 +428,7 @@ set(lib_srcs tiff.h tiffio.h tiffiop.h - tiffvers.h + "${CMAKE_CURRENT_BINARY_DIR}/tiffvers.h" uvcode.h tiffio.hxx "${CMAKE_CURRENT_BINARY_DIR}/tif_config.h" diff --git a/3rdparty/libtiff/RELEASE-DATE b/3rdparty/libtiff/RELEASE-DATE new file mode 100644 index 0000000000..68d943433e --- /dev/null +++ b/3rdparty/libtiff/RELEASE-DATE @@ -0,0 +1 @@ +20230908 diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake index a76a9ed44a..f1478e96f4 100644 --- a/cmake/OpenCVFindLibsGrfmt.cmake +++ b/cmake/OpenCVFindLibsGrfmt.cmake @@ -124,13 +124,13 @@ if(WITH_TIFF) endif() if(NOT TIFF_VERSION_STRING AND TIFF_INCLUDE_DIR) - list(GET TIFF_INCLUDE_DIR 0 _TIFF_INCLUDE_DIR) - if(EXISTS "${_TIFF_INCLUDE_DIR}/tiffvers.h") - file(STRINGS "${_TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str REGEX "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version .*") - string(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*" "\\1" TIFF_VERSION_STRING "${tiff_version_str}") - unset(tiff_version_str) - endif() - unset(_TIFF_INCLUDE_DIR) + foreach(_TIFF_INCLUDE_DIR IN LISTS TIFF_INCLUDE_DIR) + if(EXISTS "${_TIFF_INCLUDE_DIR}/tiffvers.h") + file(STRINGS "${_TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str REGEX "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version .*") + string(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*" "\\1" TIFF_VERSION_STRING "${tiff_version_str}") + unset(tiff_version_str) + endif() + endforeach() endif() set(HAVE_TIFF YES)