[cmake-developers] Improving the version selection behavior of EXACT

Rolf Eike Beer eike at sf-mail.de
Fri Jan 9 14:18:25 EST 2015


Matthew Woehlke wrote:
> On 2014-10-03 03:35, Rolf Eike Beer wrote:
> > find_package(foo 2.0 EXACT) means EXACT, i.e. only "2.0" is allowed. In
> > most cases this behavior is not the one that one would expect or need.
> > Most people would instead allow any 2.0.x version to match. This sort of
> > selection is currently impossible without additional effort in every
> > Find*.cmake that is used.
> 
> This is probably a bit late, but did anyone think of using "MATCHES" to
> say "all provided components match exactly and the rest can be whatever"?

I bet everybody will get it wrong.

Ok, this is "version 2.1 and any of it's patch versions", if _I_ got it right:

if (VER MATCHES "^2\\.1(\\..*|[^0-9].*)?$")

So this should match "2.1", "2.1a", "2.1.1", but not "2.10". What combination 
of stuff did I miss?

Eike
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150109/da6f76e2/attachment.sig>


More information about the cmake-developers mailing list