Re: [CMake] How to maintain compatibility with earlier versions?

2017-09-11 Thread Alan W. Irwin

On 2017-09-11 18:06+0300 Konstantin Tokarev wrote:




11.09.2017, 16:52, "Robert Dailey" :

So typically my setup is that I have the newest CMake installed, but
am working with projects that set cmake_minimum_required to something
like version 2.8. Will version 3.9 of CMake prevent me from using
features that were introduced after 2.8? How can I make sure that
someone with *actual* version 2.8 installed will not run into
errors/issues?


Only by testing with actual 2.8 (or whatever version you support).


I agree such testing is the only completely safe thing to do.  However,
that said, if a project specifies

cmake_minimum_required(VERSION  FATAL_ERROR)

than that, by default, implies

cmake_policy(VERSION )

i.e., all policies after  will default
to OLD (i.e., the policy available for ) behaviour.

So because of this design, CMake has pretty good backwards
compatibility, i.e., a project _should_ build the same way (with
policies identical to those in effect for its minimum cmake version)
regardless of how far a user's cmake version is ahead of the minimum
version for a project.

In practice, of course, such backwards compatibility is not perfect
which is why I typically test the build systems for my various
software projects with both their minimum CMake version and the latest
CMake version. And to avoid straining that CMake backwards
compatibility design too far, I typically also bump my cmake minimum
version for projects (and therefore the associated cmake policies) to
be not too far behind the latest CMake version.  For example, fairly
recently I bumped the PLplot minimum version from 3.0.2 (the version
supplied by Debian Oldstable = Jessie) to 3.6.2, and within a few
months (once Cygwin provides 3.7.2) I plan to bump that minimum
version again to 3.7.2 (the version supplied by Debian Stable =
Stretch).  Note that Debian Stretch was just designated the Debian
Stable version and typically Debian has a release cycle of ~2 years.
So I will likely leave that minimum version at 3.7.2 for ~2 more years
which should allow most Linux users during that interval with access
to up-to-date distro versions of CMake to use their system CMake
version rather than forcing them to use a later version of CMake that
they have to build themselves.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
--

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


Re: [CMake] How to maintain compatibility with earlier versions?

2017-09-11 Thread Konstantin Tokarev


11.09.2017, 16:52, "Robert Dailey" :
> So typically my setup is that I have the newest CMake installed, but
> am working with projects that set cmake_minimum_required to something
> like version 2.8. Will version 3.9 of CMake prevent me from using
> features that were introduced after 2.8? How can I make sure that
> someone with *actual* version 2.8 installed will not run into
> errors/issues?

Only by testing with actual 2.8 (or whatever version you support).

> --
>
> 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

-- 
Regards,
Konstantin
-- 

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


[CMake] How to maintain compatibility with earlier versions?

2017-09-11 Thread Robert Dailey
So typically my setup is that I have the newest CMake installed, but
am working with projects that set cmake_minimum_required to something
like version 2.8. Will version 3.9 of CMake prevent me from using
features that were introduced after 2.8? How can I make sure that
someone with *actual* version 2.8 installed will not run into
errors/issues?
-- 

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