[CMake] Adding Cmake version in online documentation

Ruslan Baratov ruslan_baratov at yahoo.com
Tue Nov 8 10:17:42 EST 2016


On 08-Nov-16 22:11, Dvir Yitzchaki wrote:
> But how do you know which version to declare on cmake_minimum_required?
I do hit this too. This would be a very useful feature. Sometimes I have
to manually "scan" the docs to figure out some simple facts about newly
introduces variables/commands.


On 08-Nov-16 22:22, Nils Gladitz wrote:
> On 11/08/2016 03:11 PM, Dvir Yitzchaki wrote:
>
>> But how do you know which version to declare on cmake_minimum_required?
>> If this feature will be added it won't be far from writing a script
>> that scans the commands you use and outputs the first appropriate
>> version.
>>
>
> Strictly speaking cmake_minimum_required(VERSION) is not about command
> availability but rather about behavior (cmake policies).
Except it's exactly opposite :) `cmake_minimum_required` is about new
features/commands, and policies is about behavior. If you have command
`if(IN_LIST)` since 3.3 you can't manipulate policies in such way that
it will work with CMake 2.8. However if you have warning about policy
CMP0054 (since CMake 3.2) you can set policy to old without changing
`cmake_minimum_required` (hence without forcing your CMake 2.8 users to
upgrade to CMake 3.2).

Ruslo


More information about the CMake mailing list