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

Rolf Eike Beer eike at sf-mail.de
Fri Oct 3 03:35:05 EDT 2014


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.

I came over this when I tried converting FindLua5[01].cmake to use 
FindLua.cmake, but I can't do "find_package(Lua 5.0 EXACT)" in there because 
e.g. 5.0.1 would not be accepted then, and I neither can do "find_package(Lua 
5.0)" because that may return e.g. 5.2 instead.

Since we can't change this because of the usual backward compatibility 
concerns I think we should introduce a new version mode, e.g. EXACT_OR_MINOR 
(or any other naming you find more appropiate).

In case this is aggreed on I would try to create a patch ASAP to be able to 
still land it in 3.1.

Opinions?

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/20141003/2cf517ee/attachment-0002.sig>


More information about the cmake-developers mailing list