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

Alexander Neundorf neundorf at kde.org
Mon Jan 6 17:26:49 EST 2014


On Monday 06 January 2014, Rolf Eike Beer wrote:
> Am Montag, 6. Januar 2014, 22:41:26 schrieb Alexander Neundorf:
> > Hi,
> > 
> > on cmake stage I have a simple branch AddVersionToProjectCommand.
> > This extends the project command to also accept a version number:
> > 
> > project(Foo VERSION 1.2.3 CXX)
> 
> Cool, I like this. Shouldn't there be spaces on both sides of operators
> (e.g. '>= 2')?

 ?

This basically only sets up version variables for the current project, i.e. it 
replaces

project(Foo CXX)

set(Foo_VERSION_MAJOR 1)
set(Foo_VERSION_MINOR 2)
set(Foo_VERSION_PATCH 3)
set(Foo_VERSION
    ${Foo_VERSION_MAJOR}.${Foo_VERSION_MINOR}.${Foo_VERSION_PATCH})


with one function call, which results in a set of variables with standard 
names (not related to find_package()).

Alex



More information about the cmake-developers mailing list