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

Alexander Neundorf neundorf at kde.org
Fri Jan 10 15:19:45 EST 2014


On Friday 10 January 2014, Brad King wrote:
> On 01/06/2014 04:41 PM, Alexander Neundorf wrote:
> > I modified write_basic_package_version_file() accordingly, so that you
> > can now simply do
> > 
> > project(Foo VERSION 1.2.3)
> > 
> > ...
> > 
> > write_basic_package_version_file(FooConfigVersion.cmake
> > 
> >                                  COMPATIBILITY AnyNewerVersion)
> > 
> > and this will use the version number from the project() call
> > automatically (if no VERSION has been given explicitely).
> 
> One problem left to address is what to do when a project() command is
> invoked in a subdirectory.  It will set PROJECT_NAME, PROJECT_SOURCE_DIR,
> and PROJECT_BINARY_DIR but it should also *unset* the PROJECT_VERSION_
> variables if no VERSION argument is provided.  Otherwise the version
> values will not be consistent with the project name.

right, unsetting sounds good.

Should the full version "1.2.3" be put into PROJECT_VERSION or 
PROJECT_VERSION_STRING ?
Both forms are used in different places in cmake.

Alex



More information about the cmake-developers mailing list