Add support for building with CMake.

Support for building with CMake is added for GNU, Clang and MSVC compilers.