[CMake] Misleading error message when enforcing version from foo-config-version.cmake

Brad King brad.king at kitware.com
Wed Aug 4 11:30:51 EDT 2010


On 08/04/2010 11:03 AM, Adolfo Rodríguez Tsouroukdissian wrote:
> The foo-config.cmake file is located OK, and:
> 
> find_package(Foo REQUIRED NO_MODULE)
> 
> works as expected.

Sorry, I mis-read your message.  The find_package call example clears it up.

> Now, if I do:
> 
> find_package(Foo 6.6.6 REQUIRED NO_MODULE)
> 
> and 6.6.6 is a non-valid version (i.e., PACKAGE_VERSION_COMPATIBLE is
> set to FALSE in foo-config-version.cmake), then I get the error message
> that foo-config.cmake is not found, instead of something related to the
> request of an incompatible version.

IMO there is no difference between finding incompatible versions
and no versions at all.  The required package is not present.

-Brad


More information about the CMake mailing list