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

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Fri Jan 10 11:01:09 EST 2014


Would it make sense to have "project(Foo VERSION 1.2.3)" set the variables:
  ${PROJECT_NAME}_PROJECT_VERSION_(MAJOR|MINOR|PATCH|TWEAK)

That way, the variable would remain even if project is called with VERSION
in sub directory.

Jc



On Fri, Jan 10, 2014 at 9:49 AM, Brad King <brad.king at kitware.com> 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.
>
> -Brad
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140110/1d5ea3ed/attachment.html>


More information about the cmake-developers mailing list