[CMake] Adding Cmake version in online documentation

Eric Noulard eric.noulard at gmail.com
Tue Nov 8 16:23:03 EST 2016


2016-11-08 20:26 GMT+01:00 Albrecht Schlosser <AlbrechtS.fltk at online.de>:

> On 08.11.2016 15: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.
>>>
>>
> I'd also like such an addition to the documentation for reasons discussed
> below.



I think the need is recognized by most CMake user but...


>
>
> Strictly speaking cmake_minimum_required(VERSION) is not about command
>> availability but rather about behavior (cmake policies).
>>
> [...]
>
>> I'd start by requesting the highest possible version I could justify
>> (e.g. based on availability on target platforms and user convenience)
>> and then start from there.
>>
>
> And that's exactly the (my) point. How can I find out the "highest
> possible version I could justify"?
>
> I'm a developer of a public GUI library (FLTK). In this position you don't
> know anything about the availability of CMake versions on your target
> platforms. Our intention is to keep cmake_minimum_required() as low as
> possible.
>
> That said, whenever you change a CMakeLists.txt file you should be aware
> if the commands you use are compatible with the CMake version you
> "require". There should be an easy way to find out in which version a
> particular CMake command has been introduced. Only with this information
> you can decide if you should use this fine command or better find another
> way to do the task you're going to do.
>
> I'd like to have a list of release dates (I'm not sure if there is one) as
> well as the exact version a feature was introduced to write CMakeLists.txt
> files that run on really old CMake versions


Some time ago people came up (dig the ML for the related discussion) with
compatibility matrix idea:
https://cmake.org/Wiki/CMake_Version_Compatibility_Matrix
http://public.kitware.com/pipermail/cmake/2010-December/041202.html

And it finally ends with cmake 3.0.0
http://public.kitware.com/pipermail/cmake/2015-March/059983.html

Note that this is far more complicated than simply listing when one command
appears because some command may get more options, or change their default
semantic
(using POLICY etc..) so the feature granularity leads to question like

When did the 'string' cmake command support the UUID argument ?

Before which version of CMake does get_target_property accept  non-existent
target argument without issuing any error or warning ?
(see POLICY CMP0045)

So basically, tracking all kind of behavior change is not as easy as it
seems.

How can we document the changes ? Or better extract them from the code or
documentation?

-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161108/79fbf023/attachment.html>


More information about the CMake mailing list