Minimal cmake version?

Tools/check_cmake.sh rejects cmake versions 2.8, 2.9, 3.0 and 3.1.
Why? Is 3.2 or higher required, or is 2.8 and higher not supported?

The answer to my own question appears to be that 2.8 through 3.1 are not supported.
I suppose that 2.7 is also not supported? Kinda weird test then…

Also,
sean:/usr/src/debian/px4-firmware/px4-firmware.git>find . -type f -exec grep -Hn ‘cmake_minimum_required’ {} ;
./Tools/genmsg/CMakeLists.txt:1:cmake_minimum_required(VERSION 2.8.3)
./Tools/sitl_gazebo/CMakeLists.txt:1:cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
./Tools/gencpp/CMakeLists.txt:1:cmake_minimum_required(VERSION 2.8.3)
./unittests/googletest/CMakeLists.txt:43:cmake_minimum_required(VERSION 2.6.2)
./unittests/CMakeLists.txt:1:cmake_minimum_required(VERSION 2.8)
./src/modules/uavcan/libuavcan/libuavcan/CMakeLists.txt:5:cmake_minimum_required(VERSION 2.8)
./src/modules/uavcan/libuavcan/CMakeLists.txt:5:cmake_minimum_required(VERSION 2.8)
./src/modules/uavcan/libuavcan/libuavcan_drivers/posix/CMakeLists.txt:5:cmake_minimum_required(VERSION 2.8)
./src/modules/uavcan/libuavcan/libuavcan_drivers/linux/CMakeLists.txt:5:cmake_minimum_required(VERSION 2.8)
./src/lib/ecl/EKF/CMakeLists.txt:34:cmake_minimum_required(VERSION 2.8)
./src/lib/ecl/matrix/CMakeLists.txt:1:cmake_minimum_required(VERSION 2.8)
./src/lib/DriverFramework/CMakeLists.txt:34:cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
./src/lib/DriverFramework/dspal/test/CMakeLists.txt:32:cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
./src/lib/matrix/CMakeLists.txt:1:cmake_minimum_required(VERSION 2.8)
./CMakeLists.txt:122:cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

no sign of such a requirement in the source code.

We just haven’t put that much thought into it. It sounds like we need to put some effort into determining our actual cmake version requirements, and then update the documentation and enforce it properly in the build system.
Would you be interested in fixing this properly @CarloWood?

I might, I have experience with cmake - and it seems highly unlikely that a random project can’t work with version 2.8, especially when there wasn’t a special need for it (considering no special thought went into it). However, I can only test it on my system: ubuntu linux. Changes to cmake should be tested on all operating systems to be sure it works :wink: (not that it’s likely that changes that only involve the version of cmake to break anything).

@CarloWood The blacklisted versions do not actually work, so we require 3.2 indeed (and our install instructions show you how to install it). Because we rule out < 2.8 in the check that amounts to requiring 3.2 or later.

The reason it just doesn’t ask for 3.2 straight is that if you do that it actually changes fundamental behaviour of CMake failing the build as a result. A PR setting it to 3.2 in the top level makefile and setting the right policies so the build does not blow up would be most appreciated - buts its really not our most pressing issue in this very fast moving industry right now, so I’m not going to promise that we’ll look into this any time soon (but happy to merge a PR).