From 2fc22a3deccd1454c6096a4579dd7701eaffe84d Mon Sep 17 00:00:00 2001 From: Niklas Weissner Date: Wed, 7 Feb 2024 13:45:35 +0100 Subject: FPHSA: Fix empty version message in exact match `find_package_check_version()` would use variable `_FOUND_VERSION` set by `find_package_handle_standard_args()` in a single branch when doing exact matching, causing empty version messages if it was instead called directly. This was missed in commit 6bfc442fde (FPHSA: add support of version range, 2020-09-22, v3.19.0-rc1~122^2~1) when the version check was moved into its own function. --- Modules/FindPackageHandleStandardArgs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 56ba1e6..63b2bf2 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -342,7 +342,7 @@ function(FIND_PACKAGE_CHECK_VERSION version result) set(version_msg "Found unsuitable version \"${version}\", but required is exact version \"${${package}_FIND_VERSION}\"") else () set(version_ok TRUE) - set(version_msg "(found suitable exact version \"${_FOUND_VERSION}\")") + set(version_msg "(found suitable exact version \"${version}\")") endif () else () if (NOT ${package}_FIND_VERSION VERSION_EQUAL version) -- cgit v0.12