[cmake-developers] Config files and version components

Alexander Neundorf neundorf at kde.org
Mon Jan 21 13:45:36 EST 2013


On Monday 21 January 2013, Stephen Kelly wrote:
> Alexander Neundorf wrote:
> >> > Where do you see a problem with this ?
> >> 
> >> Only that I think it's odd.
> >> 
> >> The Foo package name is 4.3.2, but if you check all the components, it
> >> looks like 4.3.2.0, which is not 'true'.
> > 
> > Is VERSION_COUNT then actually set to 3 or 4 ?
> 
> It is set correctly to 3, but still, it's something else to check. You
> can't just check the MINOR or PATCH version. You have to also check the
> COUNT.
> 
> This isn't something I'll fight against. Just something I noticed that I
> considered odd and not ideal for using.

I actually think it makes using it easier.
If you check VERSION_COUNT, then you know exactly what components you have to 
take care of.
If you don't, you can simply concatenate the components and always get a valid 
version number:
"${MAJOR}.${MINOR}.${PATCH}.${TWEAK}"
without a lot of if()'s.

Alex



More information about the cmake-developers mailing list