[3.0] contrib: update CMake calls to match 4.0
So we can cherry pick contrib updates easier in the future (needed by !6102 (merged)).
Also includes:
- building (outdated) cmake in snap
- remove redundant mkdir in aom script to match 4.0
And from 4.0:
- split build and install phases
- use local variables instead of passing all configure flags
- disable pthread in Win32 vncclient
- update glew from 1.7.0 to 2.1.0 so it can be built with CMake
- use jobserver to build CMake targets
- remove unneeded DENABLE_WIN32_IO=OFF from libebml
- contrib: remove the CMakeCache.txt at every run
- update openjpeg to 2.5.0
- contrib: mimic the Android CMake toolchain
- contrib: don't set the build mode in the toolchain file
Edited by Steve Lhomme