FindPkgConfig - moduleSpec vor pkg_check_modules does not allow to search for version smaller or greater (but not equal!)
Documentation for pkg_check_modules
says
Each <moduleSpec> must be in one of the following formats:
{moduleName} ... matches any version {moduleName}>={version} ... at least version <version> is required {moduleName}={version} ... exactly version <version> is required {moduleName}<={version} ... modules must not be newer than <version>
It misses two options:
{moduleName}>{version} ... a version higher than <version> is required
{moduleName}<{version} ... modules must be older than <version>
As an example I needed the check ImageMagick<7
to prevent building with ImageMagick 7. I used ImageMagick<7
as a workaround now, but if a user would happen to have the precise version ImageMagick 7.0.0 installed on their machine, the build would fail.