[cmake-developers] RFC: add version to project() call

Matthew Woehlke mw_triad at users.sourceforge.net
Fri Jan 10 11:41:44 EST 2014

On 2014-01-10 11:01, Jean-Christophe Fillion-Robin wrote:
> Would it make sense to have "project(Foo VERSION 1.2.3)" set the variables:
> That way, the variable would remain even if project is called with VERSION
> in sub directory.

How is that different? Do you mean to drop the PROJECT_VERSION_{...} 
entirely? That doesn't seem desirable for symmetry with the other 
PROJECT_{...} variables.

I think I'm with Brad; set the PROJECT_VERSION_{...} and 
${PROJECT_NAME}_VERSION_{...} (note; no extra literal 'PROJECT') as 
usual. Always. Whether or not VERSION was specified (i.e. unset the 
corresponding variables in such case).

Folks that use the PROJECT_{...} forms hopefully know what they are 
doing, otherwise people are hopefully using the ${PROJECT_NAME}_{...} 
forms instead.

Related: Do these affect the version properties of libraries? (Because 
OTOH if it does, I can imagine wanting to say VERSION once at the root 
and have it inherit downwards unless overridden. Maybe though that's a 
reason for it to not do so.)


More information about the cmake-developers mailing list