[cmake-developers] COMPILE_FEATURES, Mac and non-Apple clang versions

Robert Maynard robert.maynard at kitware.com
Tue Jan 3 11:41:29 EST 2017


On Tue, Jan 3, 2017 at 11:29 AM, René J.V. Bertin <rjvbertin at gmail.com> wrote:
> On Tuesday January 03 2017 10:36:54 Robert Maynard wrote:
>
> That's all nice and well but a bit delicate to expect from an unknown number of project to adapt their minimum required CMake version for a policy they probably don't even know they require.
>
>
>> The minimum cmake version of each project controls the default state
>> of the policies. So for policy 25 you need a minimum of CMake 3.0.
>> This is partially a moot point, because compiler feature detection was
>> added in CMake 3.0, so if you are expecting that feature to exist you
>> should be requiring CMake 3.0.
>
> Maybe, indeed, but that becomes a much less trivial point if the policy becomes necessary somewhere hidden deep in a module that's loaded somewhere well into running cmake. How is the user supposed to understand what happens from the error message?

It is the responsibility of the project to understand what components
of CMake they require, and correctly specify a cmake_minimum required
that satisfies all those requirements. In this case to use compile
features you need a minimum of 3.0 which also automatically enables
policy 25.

>
> The point would be moot if the minimum required cmake version could be adjusted whenever necessary, or policy 25 could be set when required.

You can explicitly do both of those things currently see:
https://cmake.org/cmake/help/v3.0/manual/cmake-policies.7.html

> Or indeed if a cmake installation can be configured locally to set a policy, or to apply a limit to how far back the minimum required version can be set.
>
> R.
>


More information about the cmake-developers mailing list