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

Rolf Eike Beer eike at sf-mail.de
Fri Oct 3 08:43:57 EDT 2014


Am Freitag, 3. Oktober 2014, 08:41:47 schrieb Brad King:
> On 10/03/2014 03:35 AM, 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.
> 
> Yes.  The "EXACT" should refer to exactly matching whatever components are
> given by the caller.  Following components should still be free to vary.
> If the caller wants them to be exact too then they should be specified.
> 
> > This sort of selection is currently impossible without additional effort
> > in every Find*.cmake that is used.
> 
> Is that because of FPHSA's implementation?

I think that is the main reason.

> > 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.
> 
> I'd rather not introduce a new API in an important command like find_package
> immediately before a release.  However, the documentation of find_package
> has always said that it is up to the Find module (or package version file
> in Config mode) for each package to decide whether a version matches.
> 
> I think FPHSA could be changed to implement the expected behavior for
> EXACT discussed above.  The current implementation effectively adds
> unlimited implicit ".0.0.0" to the caller's components as part of
> if(VERSION_EQUAL).  Instead FPHSA could truncate the available version
> to match the number of components provided by the caller's version
> request before using if(VERSION_EQUAL).

If it is acceptable to change FPHSA in that way I can just go for it.

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/cadcdfef/attachment-0002.sig>


More information about the cmake-developers mailing list