Cmake is not available on Xenial, but the system info displays a cmake version

Trying to use cmake on Xenial (with the PHP image) triggers an error saying that cmake is not available.
But the Build system information section includes this info:

cmake version

cmake version 3.12.4

This is quite confusing. How is it reporting a cmake version if cmake is not installed ?

It’s there. How are you looking for it?

$ which cmake

This is the error I got (in a build of a private repo) when I removed cmake from the list of packages of the APT addons:

.tools/travis/ line 29: cmake: command not found

I am guessing that your script’s $PATH does not inherit from the build script’s.

hmm, it might be because the script is called with sudo. Would it be possible that this is the case ?

-E might help.