The documentation lacks the instruction of CMake build in Windows, but it is strict forward to do so in MSYS2. I have added a few lines to describe that.
What's about the CMAKE_SH trick? I never had to do that.
This is a strange limitation of CMake and MSYS2. There is a sh.exe under MSYS2 path, and you will get an error because of that when you run CMake in MinGW shell. "CMAKE_SH="CMA KE_SH-NOTFOUND" tells CMake to ignore the sh.exe.