[CMake] warn if features used that require >cmake-x.y

Glenn Coombs glenn.coombs at gmail.com
Fri Jul 3 04:33:42 EDT 2015


I don't think policies are sufficient.  I just tried using the new
target_sources command that was introduced in CMake 3.1.0 in a
CMakeLists.txt file that specified cmake_minimum_required(VERSION 3.0) and
it didn't warn that the CMakeLists.txt file wouldn't work with CMake 3.0.
I think if you want to guarantee that it will work with CMake x.y then you
must always use CMake x.y instead of using newer versions and hoping they
will tell you if you have used something that won't work on the older
version you require.

On 2 July 2015 at 05:13, Stuermer, Michael SP/HZA-ZSEP <
michael.stuermer at schaeffler.com> wrote:

> Have a look at cmake_minimum_required() and cmake_policy(). I think with
> these both it should be possible to verify you are using a cmake version
> that provides all features which are required by your project.
>
> See here:
>
>
> http://www.cmake.org/cmake/help/v3.3/command/cmake_minimum_required.html?#command:cmake_minimum_required
>
> and here:
>
> http://www.cmake.org/cmake/help/v3.3/command/cmake_policy.html
>
> best regards,
> Michael
>
>
> > -----Original Message-----
> > From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Nicolas Bock
> > Sent: Wednesday, July 01, 2015 8:29 PM
> > To: cmake at cmake.org
> > Subject: [CMake] warn if features used that require >cmake-x.y
> >
> > Hi,
> >
> > is there a way to get CMake to warn if a feature is used that requires
> > a cmake version greater than some version x.y?
> >
> > Thanks,
> >
> > nick
> > --
> >
> > 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
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150703/f6cbc634/attachment.html>


More information about the CMake mailing list