Tests/FindImageMagick: Tolerate pre-release versions

The version installed from the system in our new Fedora 44 CI base
image has a beta version of ImageMagick installed, which the
FindImageMagick module can't parse.
This commit is contained in:
Tyler Yankee
2026-08-21 09:43:48 -04:00
parent 45a426a4e3
commit 59875d4a08
@@ -11,6 +11,14 @@ int main()
std::string found_version =
std::string(MagickLibVersionText) + MagickLibAddendum;
// Pre-release builds append an annotation such as " (Beta)" to
// MagickLibAddendum which FindImageMagick's ImageMagick_VERSION does not
// include.
std::string::size_type annotation = found_version.find(" (");
if (annotation != std::string::npos) {
found_version.erase(annotation);
}
std::cout << "Found ImageMagick version " << found_version
<< ", expected version " << CMAKE_EXPECTED_IMAGEMAGICK_VERSION
<< "\n";