Minimum required version of CMake updated to 3.5.0

As discussed in PR Slicer/Slicer#765, the minimum version of CMake required to build Slicer is now CMake 3.5.0

Associated changes integrated in r26201, r26202 and r26203

This will ensure the CMake version has:

  • support for VS 2015 (introduced in CMake 3.1)
  • a decent support for detecting compiler features (useful with C++11 and above)
  • as well as support for modern cmake that will be used to modernize the Slicer build system. See here and below.

CMake 3.5 is also old enough (released in April 2016) and available (same version
or above) in distributions like these ones:

  • Arch Linux
  • Ubuntu LTS 14.04, 16.04
  • OpenSUSE Leap 42.2, 42.3
  • Debian 9, Sid
  • Fedora 24/25/26
  • Slackware 14.2

See https://pkgs.org/download/cmake

Note that the statement cmake_minimum_required(VERSION 3.5) does NOT need to be updated in the extension source trees.

That said:

  • whenever possible, extension developer are encouraged to update it in the top level CMakeLists.txt. This will most likely avoid confusion …

  • the version of CMake used to build the extension need to be 3.5. To facilitate the overall maintenance, this is a hard requirement (an explicit cmake_minimum_required(VERSION 3.5) statement was added to SlicerConfig.cmake and UseSlicer.cmake

If you are interested, this presentation from Tobias Becker is a nice introduction to modern CMake:

2 Likes