On 11/08/2016 04:17 PM, Ruslan Baratov wrote:
On 08-Nov-16 22:22, Nils Gladitz wrote:
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.
I don't agree and you can not separate the two.
cmake_minimum_required() initializes the policies based on the given
version.
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).
Coincidentally I implemented both of those policies :)
Given your second example you likely shouldn't be touching the policy at
all.
A policy warning does not force your users to use a new CMake version.
In fact all that setting it to OLD does is suppress the warning.
CMake will use the old behavior in either case.
The warnings guide developers when they do bump their
cmake_minimum_required(VERSION).
By just suppressing it behavior changes might go unnoticed when the bump
does happen.
Nils
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake