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

Matthew Woehlke mw_triad at users.sourceforge.net
Wed Jan 29 10:33:21 EST 2014


On 2014-01-29 09:58, Brad King wrote:
> I reverted the 'AddVersionToProjectCommand' topic from 'next'
> and replaced it with a 'project-version-variables' topic that
> adds a policy:
>
>   Help: Format project command and variable documentation
>   http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00007dcc
>
>   project: Add optional LANGUAGES keyword
>   http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=16d040c9
>
>   project: Manage VERSION variables
>   http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e142c5a
>
>   write_basic_package_version_file: use PROJECT_VERSION
>   http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41d2f2c4
>
> The key is that project() only accepts VERSION when the
> policy is set to NEW.  After release this will be automatic
> because one would need cmake_minimum_required() to specify a
> high enough version to understand the new project() signature
> and that would set the policy to NEW.  Once the policy is
> set to NEW then we can freely clear variables when project()
> is not given a VERSION.

Can one use project(VERSION) and later set the policy to OLD to get the 
old, don't-unset-the-variables behavior from that point onwards?

-- 
Matthew




More information about the cmake-developers mailing list