Skip to content

FPHSA: Improve error message when VERSION_VAR is empty or has been unset()

Previously, when VERSION_VAR is set but empty, FPHSA emitted a confusing error message, saying that the package was found but of an unsuitable version "". Fix the error message to state that the package was not found.

Original Description

This is a quick patch that I wrote when trying to debug the issue. It needs more testing, and I should also address the in-code comment that says 'check with DEFINED here as the requested or found version may be "0"'.

...

Currently when VERSION_VAR is set but empty, find_package_handle_standard_args() emits a confusing error message, saying that the package was found but of an unsuitable version "".

With this patch the error message correctly states that the package was not found.

Fixes: #23807 (closed)

Edited by Brad King

Merge request reports