From c4884f5f481a9ea973728c12c7ef23621add950d Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sat, 17 Oct 2026 22:24:46 -0700 Subject: [PATCH] fix(build): clear stale dep version before refinding a local build When a dependency was found but too old, so an auto-build version would be used, some uncleared variables were making the cmake dependency report show the too-old version. (E.g. "TIFF 4.0.9" when 4.7.1 was actually built and used.) Signed-off-by: Larry Gritz --- src/cmake/dependency_utils.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cmake/dependency_utils.cmake b/src/cmake/dependency_utils.cmake index 2a90b2db16..c9643b3f10 100644 --- a/src/cmake/dependency_utils.cmake +++ b/src/cmake/dependency_utils.cmake @@ -548,14 +548,17 @@ macro (checked_find_package pkgname) # A prior find_package() may have left a bunch of cruft from a # rejected, unsuitable system install in its Find module. Clear it # here so it does not pollute our attempt to use the one we just - # built and are about to re-find. + # built and are about to re-find. This includes the version, or a + # stale one from the rejected install would be reported. foreach (_v IN ITEMS ${pkgname}_LIBRARY ${pkgname}_LIBRARIES ${pkgname}_LIBRARY_RELEASE ${pkgname}_LIBRARY_DEBUG ${pkgname}_INCLUDE_DIR ${pkgname}_INCLUDE_DIRS ${pkgname_upper}_LIBRARY ${pkgname_upper}_LIBRARIES ${pkgname_upper}_LIBRARY_RELEASE ${pkgname_upper}_LIBRARY_DEBUG - ${pkgname_upper}_INCLUDE_DIR ${pkgname_upper}_INCLUDE_DIRS) + ${pkgname_upper}_INCLUDE_DIR ${pkgname_upper}_INCLUDE_DIRS + ${pkgname}_VERSION ${pkgname}_VERSION_STRING + ${pkgname_upper}_VERSION ${pkgname_upper}_VERSION_STRING) unset (${_v}) unset (${_v} CACHE) endforeach ()